0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed picker for local tz use (#21658)

ref 47b8161805

This ended up inverting the behavior, such that TZs far in advance of
GMT fouled up. This change builds the date by date components in the
local TZ so we should not run into further trouble...
This commit is contained in:
Steve Larson 2024-11-19 15:54:50 -06:00 committed by GitHub
parent 05127ddc5c
commit 2a0fc6fd1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,7 +53,10 @@ export default class GhDateTimePicker extends Component {
@computed('_date')
get localDateValue() {
return this._date.toDate();
// extract parts so we can build a date object that is strictly the day in the local tz
const [year, month, day] = this._date.format(DATE_FORMAT).split('-').map(Number);
const date = new Date(year, month - 1, day); // month is 0-indexed in the js date object
return date;
}
@computed('blogTimezone')