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

Commit

Permalink
Fix min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Oct 14, 2018
1 parent b585658 commit 0466724
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2>Datetime</h2>

<div class="example">
<div class="example-inputs">
<datetime type="datetime" v-model="datetime"></datetime>
<datetime type="datetime" v-model="datetimeEmpty" :min-datetime="minDatetime" :max-datetime="maxDatetime"></datetime>

<div class="values">
<p>
Expand Down
14 changes: 10 additions & 4 deletions src/DatetimePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<datetime-year-picker
v-if="step === 'year'"
@change="onChangeYear"
:min-date="minDatetime"
:max-date="maxDatetime"
:min-date="minDatetimeUTC"
:max-date="maxDatetimeUTC"
:year="year"></datetime-year-picker>
<datetime-calendar
v-if="step === 'date'"
@change="onChangeDate"
:year="year"
:month="month"
:day="day"
:min-date="minDatetime"
:max-date="maxDatetime"
:min-date="minDatetimeUTC"
:max-date="maxDatetimeUTC"
:week-start="weekStart"
></datetime-calendar>
<datetime-time-picker
Expand Down Expand Up @@ -146,6 +146,12 @@ export default {
day: 'numeric'
})
},
minDatetimeUTC () {
return this.minDatetime.toUTC()
},
maxDatetimeUTC () {
return this.maxDatetime.toUTC()
},
minTime () {
return (
this.minDatetime &&
Expand Down

0 comments on commit 0466724

Please sign in to comment.