Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto raphaelbadia-v1.x

* 'v1.x' of https://github.com/raphaelbadia/vue-datetime:
  Fix datetime popup display bug when using UTC zone
  • Loading branch information
mariomka committed Oct 13, 2018
2 parents ae1fe2e + 598253e commit 5cc55c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Datetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export default {
return this.datetime ? this.datetime.setZone(this.zone) : this.newPopupDatetime()
},
popupMinDatetime () {
return this.minDatetime ? DateTime.fromISO(this.minDatetime) : null
return this.minDatetime ? DateTime.fromISO(this.minDatetime).setZone(this.zone) : null
},
popupMaxDatetime () {
return this.maxDatetime ? DateTime.fromISO(this.maxDatetime) : null
return this.maxDatetime ? DateTime.fromISO(this.maxDatetime).setZone(this.zone) : null
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/DatetimeCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default {
data () {
return {
newDate: DateTime.fromObject({ year: this.year, month: this.month, timeZone: 'UTC' }),
newDate: DateTime.fromObject({ year: this.year, month: this.month, zone: 'utc' }),
weekdays: weekdays(this.weekStart),
months: months()
}
Expand Down
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function monthDays (year, month, weekStart) {
}

export function monthDayIsDisabled (minDate, maxDate, year, month, day) {
const date = DateTime.fromObject({ year, month, day })
const date = DateTime.fromObject({ year, month, day, zone: 'utc' })

minDate = minDate ? startOfDay(minDate) : null
maxDate = maxDate ? startOfDay(maxDate) : null
Expand Down

0 comments on commit 5cc55c4

Please sign in to comment.