vue-time-date-range-picker-vue3
Advanced tools
Comparing version 1.4.14 to 1.4.15
{ | ||
"name": "vue-time-date-range-picker-vue3", | ||
"version": "1.4.14", | ||
"version": "1.4.15", | ||
"description": "a vue time date range picker", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -157,2 +157,19 @@ // eslint-disable-next-line import/no-unresolved | ||
/** | ||
* Get Start Of A Date in UTC time zone. refer to moment documentation | ||
* | ||
* @param {Date} date | ||
* @param {String} of | ||
* @returns {Date} | ||
*/ | ||
// eslint-disable-next-line class-methods-use-this | ||
UTCstartOf(date, of, format) { | ||
const startOf = moment(date) | ||
.locale(this.lang) | ||
.startOf(of) | ||
.toDate(); | ||
return this.toUTC(startOf, format); | ||
} | ||
/** | ||
* Get End Of A Date. refer to moment documentation | ||
@@ -318,2 +335,9 @@ * | ||
} | ||
formattedHourToSeconds(time) { | ||
if (!time) return 0; | ||
const [hours, minutes] = time.split(":"); | ||
return (+hours) * 3600 + (+minutes) * 60; | ||
} | ||
} |
@@ -97,2 +97,13 @@ import Util from './Util'; | ||
}, | ||
isValidTimeFormat(value) { | ||
const { start, end } = value; | ||
const timeRegexp = new RegExp("^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$"); | ||
if (start && !start.match(timeRegexp)) return false; | ||
if (end && !end.match(timeRegexp)) return false; | ||
return true; | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
63427
407