Skip to content

Commit

Permalink
fix: fix dayjs localizer merge function to not change min and max upo…
Browse files Browse the repository at this point in the history
…n tz change
  • Loading branch information
hassen committed Jan 21, 2025
1 parent 1a6a993 commit a2b8398
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/localizers/dayjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ export default function (dayjsLib) {
const tm = dayjs(time).format('HH:mm:ss')
const dt = dayjs(date).startOf('day').format('MM/DD/YYYY')
// We do it this way to avoid issues when timezone switching
return dayjsLib(`${dt} ${tm}`, 'MM/DD/YYYY HH:mm:ss').toDate()
const mergedDateTime = dayjs(`${dt} ${tm}`).toDate()
return dayjsLib(mergedDateTime).utc(true).toDate()
}

function add(date, adder, unit) {
Expand Down

0 comments on commit a2b8398

Please sign in to comment.