mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-17 05:18:33 +05:30
Merge branch 'main' into transpose-csv-feat
This commit is contained in:
commit
9a5bc91e93
1 changed files with 23 additions and 18 deletions
|
|
@ -50,8 +50,9 @@ 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(
|
||||||
|
Intl.supportedValuesOf('timeZone').map((tz) => {
|
||||||
const formatter = new Intl.DateTimeFormat('en', {
|
const formatter = new Intl.DateTimeFormat('en', {
|
||||||
timeZone: tz,
|
timeZone: tz,
|
||||||
timeZoneName: 'shortOffset'
|
timeZoneName: 'shortOffset'
|
||||||
|
|
@ -62,14 +63,18 @@ const timezoneOptions = [
|
||||||
.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
|
||||||
|
{
|
||||||
|
value,
|
||||||
|
label: `${value} (${tz})`
|
||||||
|
}
|
||||||
|
];
|
||||||
})
|
})
|
||||||
.sort((a, b) =>
|
).values()
|
||||||
a.value.localeCompare(b.value, undefined, { numeric: true })
|
).sort((a, b) => a.value.localeCompare(b.value, undefined, { numeric: true }))
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const exampleCards: CardExampleType<InitialValuesType>[] = [
|
const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue