Skip to content

Commit d2be354

Browse files
mattwang44Flynn Hou
authored andcommitted
fix(schdule): derive correct date based on timezone
1 parent d8c7f32 commit d2be354

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/strings.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const datetimeToString = (source, options = defaultDatetimeOptions) => {
2222
options.inputFormat || defaultDatetimeOptions.inputFormat
2323
const outputFormat =
2424
options.outputFormat || defaultDatetimeOptions.outputFormat
25-
return dayjs(source, inputFormat).format(outputFormat)
25+
26+
const offset = new Date().getTimezoneOffset()
27+
return dayjs(source, inputFormat).subtract(offset, 'm').format(outputFormat)
2628
}
2729

2830
export const parseDate = (

0 commit comments

Comments
 (0)