Removed unused code
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-09-20 10:10:25 +02:00
parent 4494522ad1
commit 69346a17a0
1 changed files with 4 additions and 9 deletions

View File

@ -84,23 +84,18 @@ export default class Calendar extends FormInput {
}
getWeekdays() {
// A partir de la fecha "default", ir al primer mes del año
// y dividir el numero de días del mes entre 7 para obtener el numero de semanas
// e ir sumando hasta llegar al mes actual
// a partir de ese numero incrementar segun el numero de semanas del mes
if (!this.moment) return;
const totalSlots = this.lastDay() + this.weekdayOffset;
const weeks = Math.ceil(totalSlots / 7);
// console.log(this.lastDay());
const m = this.moment(this.defaultDate);
const firstWeekNumber = m.set('date', 1).isoWeek();
const dated = this.moment(this.defaultDate);
const firstWeekNumber = dated.set('date', 1).isoWeek();
const weekNumbers = [];
for (let w = 0; w < weeks; w++) {
let weekNumber = firstWeekNumber;
if (m.get('month') == 0 && firstWeekNumber > 1 && w > 0)
if (dated.get('month') == 0 && firstWeekNumber > 1 && w > 0)
weekNumber = 0;
weekNumbers.push(weekNumber + w);