add Meteo part

This commit is contained in:
Romulus21
2023-09-24 11:19:58 +02:00
parent bfaf82f264
commit 33b2044859
23 changed files with 429 additions and 31 deletions

View File

@@ -1,7 +1,15 @@
const weekDays = ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche']
interface Date {
getWeekDay(): string,
toSQLDate(): string,
}
Date.prototype.toSQLDate = function (): string {
return (new Date(this)).toISOString().split('T')[0]
}
Date.prototype.getWeekDay = function () {
const dayIndex = this.getDay() === 0 ? 6 : this.getDay() - 1
return weekDays[dayIndex]
}