Skip to content

Commit

Permalink
v.2.0.9
Browse files Browse the repository at this point in the history
[feature] remove max time value from processing
  • Loading branch information
scarry1992 committed Feb 7, 2020
1 parent fd6ee3c commit 3e90103
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datetimerangepicker",
"version": "2.0.8",
"version": "2.0.9",
"description": "Date-time-range picker based on Quasar Framework",
"productName": "DateTimeRangePicker",
"cordovaId": "org.cordova.quasar.app",
Expand Down
14 changes: 0 additions & 14 deletions src/components/DateRangePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export default {
dateRangeConfig: {
mode: 'single',
inline: true,
maxDate: (new Date()).setHours(23, 59, 59, 999),
locale: {
firstDayOfWeek: 1
}
Expand Down Expand Up @@ -122,7 +121,6 @@ export default {
this.dateRangeMode = mode
let config = {
inline: true,
maxDate: (new Date()).setHours(23, 59, 59, 999),
locale: this.dateRangeConfig.locale,
plugins: [ new ScrollPlugin() ]
}
Expand Down Expand Up @@ -159,7 +157,6 @@ export default {
} else if (mode === DATE_RANGE_MODE_WEEK) {
let getCurr = () => new Date(range[0].valueOf())
let curr = getCurr()
let newDate = new Date()
let currentDay = curr.getDay()
if (this.dateRangeConfig.locale && this.dateRangeConfig.locale.firstDayOfWeek) {
let firstDayOfWeek = this.dateRangeConfig.locale.firstDayOfWeek
Expand All @@ -171,21 +168,14 @@ export default {
firstday.setHours(0, 0, 0, 0)
let lastday = new Date(getCurr().setDate(last))
lastday.setHours(23, 59, 59, 999)
if (lastday > newDate) {
lastday = newDate
}
range = [firstday, lastday]
} else if (mode === DATE_RANGE_MODE_MONTH) {
let newDate = new Date()
let date = new Date(range[0].valueOf() + 86400000), y = date.getUTCFullYear(), m = date.getUTCMonth()
let firstday = new Date(y, m, 1)
firstday.setHours(0, 0, 0, 0)
let lastday = new Date(y, m + 1, 1)
lastday.setHours(0, 0, 0, 0)
lastday = new Date(lastday - 1)
if (lastday > newDate) {
lastday = newDate
}
range = [firstday, lastday]
} else if (mode === DATE_RANGE_MODE_CURRENT) {
let begin = this.currentBeginTime
Expand All @@ -197,10 +187,6 @@ export default {
last.setHours(end.getHours(), end.getMinutes(), end.getSeconds())
range = [first, last]
}
let now = new Date()
if (range[1] > now) {
range[1] = now
}
return range
},
currentDateRangeModelChangeHandler (range) {
Expand Down

0 comments on commit 3e90103

Please sign in to comment.