Skip to content

Commit 7d2aa77

Browse files
7assenTlilihassen
andauthored
fix: fix dayjs localizer merge function to not change min and max upon tz change (#2712)
Co-authored-by: hassen <[email protected]>
1 parent 9c63b1d commit 7d2aa77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/localizers/dayjs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ export default function (dayjsLib) {
192192
const tm = dayjs(time).format('HH:mm:ss')
193193
const dt = dayjs(date).startOf('day').format('MM/DD/YYYY')
194194
// We do it this way to avoid issues when timezone switching
195-
return dayjsLib(`${dt} ${tm}`, 'MM/DD/YYYY HH:mm:ss').toDate()
195+
const mergedDateTime = dayjs(`${dt} ${tm}`).toDate()
196+
return dayjsLib(mergedDateTime).utc(true).toDate()
196197
}
197198

198199
function add(date, adder, unit) {

0 commit comments

Comments
 (0)