mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix one day shift in datepicker for DateTime column [WIP]
Summary: Datepicker reads date using getUTCDate() but we used to parse date using the document timezone instead of utc, hence the 1day shift. Test Plan: Manual testing. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3801
This commit is contained in:
parent
6109b89d1b
commit
bc43e16bc7
@ -72,7 +72,8 @@ function DateEditor(options) {
|
|||||||
toValue: (date, format, language) => {
|
toValue: (date, format, language) => {
|
||||||
const timestampSec = parseDate(date, {
|
const timestampSec = parseDate(date, {
|
||||||
dateFormat: this.safeFormat,
|
dateFormat: this.safeFormat,
|
||||||
timezone: this.timezone,
|
// datepicker reads date in utc (ie: using date.getUTCDate()).
|
||||||
|
timezone: 'UTC',
|
||||||
});
|
});
|
||||||
return (timestampSec === null) ? null : new Date(timestampSec * 1000);
|
return (timestampSec === null) ? null : new Date(timestampSec * 1000);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user