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:
parent
05127ddc5c
commit
2a0fc6fd1e
1 changed files with 4 additions and 1 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue