993
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 3: | Linha 3: | ||
Date.prototype.getWeekNumber = function () { | Date.prototype.getWeekNumber = function () { | ||
let d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())); | let d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())); | ||
d.setDate(d.getDate() + 2); | |||
d.setDate(d.getDate() + 2) | |||
let dayNum = d.getUTCDay() || 7; | let dayNum = d.getUTCDay() || 7; | ||
let yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); | let yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); | ||
Linha 11: | Linha 10: | ||
const url = window.location.origin; | const url = window.location.origin; | ||
let actualWeekNumber = new Date().getWeekNumber(); | |||
const dzCard = document.getElementById('dz-card'); | const dzCard = document.getElementById('dz-card'); | ||
const today = new Date(); | |||
if(today.getDay() === 1) { | |||
if(today.getHours() < 7 && today.getMinutes() < 40) actualWeekNumber--; | |||
} | |||
const dzWeeks = [ | const dzWeeks = [ |