Expand range of calendar weeks in App2.vue to get weeks int the future and in the past

The code has been altered to increase the range of weeks computed from 15 to 30, with a modification to the 'getMonday' method accordingly. This enhances the user calendar experience by providing a wider time array to choose from.
This commit is contained in:
2024-07-05 09:58:49 +02:00
parent 0573f56782
commit 5666b8b647

View File

@@ -237,8 +237,8 @@ const dateOptions: Intl.DateTimeFormatOptions = {
};
const lastWeeks = computed((): Weeks[] =>
Array.from(Array(15).keys()).map((w) => {
const lastMonday = getMonday(-w);
Array.from(Array(30).keys()).map((w) => {
const lastMonday = getMonday(15-w);
return {
value: dateToISO(lastMonday),
text: `Semaine du ${lastMonday.toLocaleDateString("fr-FR", dateOptions)}`,