mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
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:
parent
f3954131ac
commit
2194cb952d
2 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue