Skip to content

Commit

Permalink
Fixed jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmathew900 committed Oct 6, 2024
1 parent e5a2ee0 commit 994e89d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Empty file added 0
Empty file.
7 changes: 7 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const hasTimezone = dateString => {

// eslint-disable-next-line import/exports-last
export const dayjs = (...args) => {
if (
pureDayjs.tz().$x.$timezone === pureDayjs.tz.guess() ||
pureDayjs.tz().$x.$timezone === undefined
) {
return pureDayjs(...args);
}

if (args.length > 0 && typeof args[0] === "string") {
const pureDayjsArgs = args.slice(0, Math.min(args.length, 2));

Expand Down

0 comments on commit 994e89d

Please sign in to comment.