vue-hotel-datepicker
Advanced tools
Comparing version 4.0.0-beta.15 to 4.0.0
{ | ||
"name": "vue-hotel-datepicker", | ||
"version": "4.0.0-beta.15", | ||
"version": "4.0.0", | ||
"description": "A responsive date range picker for Vue.js that displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more", | ||
@@ -40,3 +40,2 @@ "author": "krystalcampioni <hello@krystalcampioni.com>", | ||
"dependencies": { | ||
"core-js": "^3.6.5", | ||
"fecha": "^4.2.0", | ||
@@ -47,16 +46,17 @@ "lodash.throttle": "^4.1.1", | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.5.6", | ||
"@vue/cli-plugin-eslint": "~4.5.6", | ||
"@vue/cli-plugin-unit-jest": "~4.5.6", | ||
"@vue/cli-service": "~4.5.6", | ||
"@vue/eslint-config-airbnb": "^5.1.0", | ||
"@vue/cli-plugin-babel": "~4.5.10", | ||
"@vue/cli-plugin-eslint": "~4.5.10", | ||
"@vue/cli-plugin-unit-jest": "~4.5.10", | ||
"@vue/cli-service": "~4.5.10", | ||
"@vue/eslint-config-airbnb": "^5.3.0", | ||
"@vue/eslint-config-prettier": "^6.0.0", | ||
"@vue/test-utils": "^1.1.0", | ||
"@vue/test-utils": "^1.1.2", | ||
"babel-eslint": "^10.1.0", | ||
"chai": "^4.2.0", | ||
"core-js": "^3.8.2", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-prettier": "^3.3.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"prettier": "^2.2.1", | ||
"sass": "^1.26.10", | ||
"sass": "^1.32.4", | ||
"sass-loader": "^8.0.2", | ||
@@ -63,0 +63,0 @@ "vue-template-compiler": "^2.6.12" |
@@ -23,10 +23,10 @@ /* eslint-disable vars-on-top */ | ||
}, | ||
nextDateByDayOfWeek(weekDay, referenceDate) { | ||
nextDateByDayOfWeek(weekDay, referenceDate, i18n) { | ||
const newReferenceDate = new Date(referenceDate) | ||
let newWeekDay = weekDay.toLowerCase() | ||
// const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] | ||
const days = this.i18n['day-names'] | ||
const days = i18n ? i18n['day-names'] : ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] | ||
const referenceDateDay = newReferenceDate.getDay() | ||
for (let i = 7; i--; ) { | ||
for (let i = 7; ; i--) { | ||
if (newWeekDay === days[i]) { | ||
@@ -42,7 +42,7 @@ newWeekDay = i <= referenceDateDay ? i + 7 : i | ||
}, | ||
nextDateByDayOfWeekArray(daysArray, referenceDate) { | ||
nextDateByDayOfWeekArray(daysArray, referenceDate, i18n) { | ||
const tempArray = [] | ||
for (let i = 0; i < daysArray.length; i++) { | ||
tempArray.push(new Date(this.nextDateByDayOfWeek(daysArray[i], referenceDate))) | ||
tempArray.push(new Date(this.nextDateByDayOfWeek(daysArray[i], referenceDate, i18n))) | ||
} | ||
@@ -52,3 +52,3 @@ | ||
}, | ||
nextDateByDayOfWeekObject(days, referenceDate) { | ||
nextDateByDayOfWeekObject(days, referenceDate, i18n) { | ||
const daysArray = Object.entries(days) | ||
@@ -58,3 +58,3 @@ .map((e) => (e[1] ? e[0] : false)) | ||
return this.nextDateByDayOfWeekArray(daysArray, referenceDate) | ||
return this.nextDateByDayOfWeekArray(daysArray, referenceDate, i18n) | ||
}, | ||
@@ -83,12 +83,13 @@ countDays(start, end) { | ||
const firstDay = this.getFirstDayOfMonth(date) | ||
const day = firstDay.getDay() | ||
let offset = 0 | ||
if (firstDayOfWeek > 0) { | ||
offset = firstDay.getDay() === 0 ? -7 + firstDayOfWeek : firstDayOfWeek | ||
offset = !day ? -6 : firstDayOfWeek | ||
} | ||
return new Date(firstDay.setDate(firstDay.getDate() - (firstDay.getDay() - offset))) | ||
return new Date(firstDay.setDate(firstDay.getDate() - (day - offset))) | ||
}, | ||
getFirstDayOfMonth(date) { | ||
return new Date(date.getFullYear(), date.getMonth(), 1) | ||
return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0) | ||
}, | ||
@@ -95,0 +96,0 @@ getNextMonth(date) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3
36
0
0
2566792
17
30212
- Removedcore-js@^3.6.5
- Removedcore-js@3.37.1(transitive)