add weekStartDay logic to date-table

This commit is contained in:
Sergio Crisostomo 2017-09-26 22:25:16 +02:00
parent 8930367486
commit 0916642089

View file

@ -89,8 +89,8 @@
}, },
cells () { cells () {
const date = new Date(this.year, this.month, 1); const date = new Date(this.year, this.month, 1);
let day = getFirstDayOfMonth(date); // day of first day const weekStartDay = Number(this.t('i.datepicker.weekStartDay'));
day = (day === 0 ? 7 : day); const day = (getFirstDayOfMonth(date) || 7) - weekStartDay; // day of first day
const today = clearHours(new Date()); // timestamp of today const today = clearHours(new Date()); // timestamp of today
const selectDay = clearHours(new Date(this.value)); // timestamp of selected day const selectDay = clearHours(new Date(this.value)); // timestamp of selected day
const minDay = clearHours(new Date(this.minDate)); const minDay = clearHours(new Date(this.minDate));