(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
pull/370/head
Cyprien P 1 year ago
parent 6109b89d1b
commit bc43e16bc7

@ -72,7 +72,8 @@ function DateEditor(options) {
toValue: (date, format, language) => {
const timestampSec = parseDate(date, {
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);
},

Loading…
Cancel
Save