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
parent 7771b27b55
commit eb9b9d8f69
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
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>
@ -1325,5 +1327,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>