Fix first day of week not depending on locale

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-12-13 17:20:33 +01:00 committed by tykayn
parent 124a9cb6a6
commit 53ab9ac7b2
3 changed files with 19 additions and 2 deletions

View File

@ -11,7 +11,7 @@
<actor-auto-complete v-model="assignedTo" />
</b-field>
<b-field :label="$t('Due on')">
<b-datepicker v-model="dueDate" />
<b-datepicker v-model="dueDate" :first-day-of-week="firstDayOfWeek" />
</b-field>
</div>
</div>
@ -99,5 +99,9 @@ export default class Todo extends Vue {
});
}
}
get firstDayOfWeek(): number {
return this.$dateFnsLocale?.options?.weekStartsOn || 0;
}
}
</script>

View File

@ -53,6 +53,7 @@
id: 'begins-on-field',
'aria-next-label': $t('Next month'),
'aria-previous-label': $t('Previous month'),
'first-day-of-week': firstDayOfWeek,
}"
>
</b-datetimepicker>
@ -73,6 +74,7 @@
id: 'ends-on-field',
'aria-next-label': $t('Next month'),
'aria-previous-label': $t('Previous month'),
'first-day-of-week': firstDayOfWeek,
}"
>
</b-datetimepicker>
@ -1324,5 +1326,9 @@ export default class EditEvent extends Vue {
isOnline,
};
}
get firstDayOfWeek(): number {
return this.$dateFnsLocale?.options?.weekStartsOn || 0;
}
}
</script>

View File

@ -59,7 +59,10 @@
: $t('Showing events before')
"
>
<b-datepicker v-model="dateFilter" />
<b-datepicker
v-model="dateFilter"
:first-day-of-week="firstDayOfWeek"
/>
<b-button
@click="dateFilter = new Date()"
class="reset-area"
@ -473,6 +476,10 @@ export default class MyEvents extends Vue {
get hideCreateEventButton(): boolean {
return !!this.config?.restrictions?.onlyGroupsCanCreateEvents;
}
get firstDayOfWeek(): number {
return this.$dateFnsLocale?.options?.weekStartsOn || 0;
}
}
</script>