mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
Merge branch 'main' into transpose-csv-feat
This commit is contained in:
@@ -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>[] = [
|
||||||
|
Reference in New Issue
Block a user