Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use default format version in dropdown; fix: FV2504 is now in June, not April #419

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,24 @@ export class FormatVersionSelectComponent implements ControlValueAccessor, OnIni
label: this.getFormatVersionDate(v),
}))
),
tap(() => this.control.enable())
tap(() => {
const defaultVersion = this.getDefaultFormatVersion();
this.control.setValue(defaultVersion);
if (this.onChange) {
this.onChange(defaultVersion);
}
this.control.enable();
})
);
}

/**
* Returns the default format version based on a hardcoded date check.
*/
private getDefaultFormatVersion(): string {
const keyDate24hLFW = new Date('2025-06-06');
return new Date() < keyDate24hLFW ? 'FV2410' : 'FV2504';
}
writeValue(formatVersion: string): void {
this.control.setValue(formatVersion);
}
Expand Down Expand Up @@ -75,7 +89,7 @@ export class FormatVersionSelectComponent implements ControlValueAccessor, OnIni
FV2310: 'Oktober 2023 (FV2310)',
FV2404: 'April 2024 (FV2404)',
FV2410: 'Oktober 2024 (FV2410)',
FV2504: 'April 2025 (FV2504)',
FV2504: 'Juni 2025 (FV2504)',
FV2510: 'Oktober 2025 (FV2510)',
};
return mapping[formatVersion] || formatVersion;
Expand Down