fix(planner): respect first day of week setting in schedule dialog

Wait for localization config to load before rendering mat-calendar
so DateAdapter.getFirstDayOfWeek() returns the user's configured value.

Fixes #5935
This commit is contained in:
Johannes Millan 2026-01-09 13:36:49 +01:00
parent f3954131ac
commit 2194cb952d
2 changed files with 14 additions and 6 deletions

View file

@ -31,12 +31,14 @@
</div>
<mat-dialog-content>
<mat-calendar
(keydown)="onKeyDownOnCalendar($event)"
[selected]="selectedDate"
[minDate]="minDate"
(selectedChange)="dateSelected($event)"
></mat-calendar>
@if (isConfigReady()) {
<mat-calendar
(keydown)="onKeyDownOnCalendar($event)"
[selected]="selectedDate"
[minDate]="minDate"
(selectedChange)="dateSelected($event)"
></mat-calendar>
}
@if (isShowEnterMsg) {
<div

View file

@ -102,6 +102,12 @@ export class DialogScheduleTaskComponent implements AfterViewInit {
private _globalConfigService = inject(GlobalConfigService);
private readonly _dateAdapter = inject(DateAdapter);
// Wait for localization config to be loaded before rendering calendar
// This ensures DateAdapter.getFirstDayOfWeek() returns the correct value
readonly isConfigReady = computed(
() => this._globalConfigService.localization() !== undefined,
);
T: typeof T = T;
minDate = new Date();
readonly calendar = viewChild.required(MatCalendar);