Merge branch 'main' into transpose-csv-feat

This commit is contained in:
Chesterkxng
2025-04-10 18:46:35 +02:00

View File

@@ -50,26 +50,31 @@ const validationSchema = Yup.object({
const timezoneOptions = [ const timezoneOptions = [
{ value: 'local', label: 'Local Time' }, { value: 'local', label: 'Local Time' },
...Intl.supportedValuesOf('timeZone') ...Array.from(
.map((tz) => { new Map(
const formatter = new Intl.DateTimeFormat('en', { Intl.supportedValuesOf('timeZone').map((tz) => {
timeZone: tz, const formatter = new Intl.DateTimeFormat('en', {
timeZoneName: 'shortOffset' timeZone: tz,
}); timeZoneName: 'shortOffset'
});
const offset = const offset =
formatter formatter
.formatToParts(new Date()) .formatToParts(new Date())
.find((part) => part.type === 'timeZoneName')?.value || ''; .find((part) => part.type === 'timeZoneName')?.value || '';
return { const value = offset.replace('UTC', 'GMT');
value: offset.replace('UTC', 'GMT'),
label: `${offset.replace('UTC', 'GMT')} (${tz})` return [
}; value, // key for Map to ensure uniqueness
}) {
.sort((a, b) => value,
a.value.localeCompare(b.value, undefined, { numeric: true }) label: `${value} (${tz})`
) }
];
})
).values()
).sort((a, b) => a.value.localeCompare(b.value, undefined, { numeric: true }))
]; ];
const exampleCards: CardExampleType<InitialValuesType>[] = [ const exampleCards: CardExampleType<InitialValuesType>[] = [