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

Commit

Permalink
Rename date by datetime in Datetime.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Jan 20, 2018
1 parent 035d4da commit 296f2c0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Datetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ export default {
},
data () {
const date = DateTime.fromISO(this.value).toUTC()
const datetime = DateTime.fromISO(this.value).toUTC()
return {
isOpen: false,
date: date.isValid ? date : null
datetime: datetime.isValid ? datetime : null
}
},
watch: {
value (newValue) {
const date = DateTime.fromISO(newValue).toUTC()
const datetime = DateTime.fromISO(newValue).toUTC()
this.date = date.isValid ? date : null
this.datetime = datetime.isValid ? datetime : null
}
},
Expand All @@ -117,10 +117,10 @@ export default {
inputValue () {
const format = this.format || (this.type === 'date' ? DateTime.DATE_MED : DateTime.DATETIME_MED)
return this.date ? this.date.setZone(this.zone).toLocaleString(format) : ''
return this.datetime ? this.datetime.setZone(this.zone).toLocaleString(format) : ''
},
popupDate () {
return this.date ? this.date.setZone(this.zone) : DateTime.utc().setZone(this.zone)
return this.datetime ? this.datetime.setZone(this.zone) : DateTime.utc().setZone(this.zone)
},
popupMinDatetime () {
return this.minDatetime ? DateTime.fromISO(this.minDatetime) : null
Expand All @@ -132,13 +132,13 @@ export default {
methods: {
emitInput () {
let date = this.date ? this.date.setZone(this.valueZone) : null
let datetime = this.datetime ? this.datetime.setZone(this.valueZone) : null
if (date && this.type === 'date') {
date = clearTime(this.date)
if (datetime && this.type === 'date') {
datetime = clearTime(this.datetime)
}
this.$emit('input', date ? date.toISO() : '')
this.$emit('input', datetime ? datetime.toISO() : '')
},
open (event) {
event.target.blur()
Expand All @@ -148,8 +148,8 @@ export default {
close () {
this.isOpen = false
},
confirm (date) {
this.date = date.toUTC()
confirm (datetime) {
this.datetime = datetime.toUTC()
this.emitInput()
this.close()
},
Expand Down

0 comments on commit 296f2c0

Please sign in to comment.