Skip to content

Instantly share code, notes, and snippets.

@hrdtbs
Created January 18, 2022 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrdtbs/ac15e51cb95dadc42930cb929d6f7590 to your computer and use it in GitHub Desktop.
Save hrdtbs/ac15e51cb95dadc42930cb929d6f7590 to your computer and use it in GitHub Desktop.
interface LocaleDateOptions {
/**
* The locale matching algorithm to use.
* Possible values are "lookup" and "best fit"; the default is "best fit".
* @default "best fit"
*/
localeMatcher?: "lookup" | "best fit"
/**
* The representation of the weekday.
*/
weekday?: "long" | "short" | "narrow"
/**
* The representation of the era
*/
era?: "long" | "short" | "narrow"
/**
* The representation of the year.
*/
year?: "numeric" | "2-digit"
/**
* The representation of the month.
*/
month?: "numeric" | "2-digit" | "narrow" | "short" | "long"
/**
* The representation of the day.
*/
day?: "numeric" | "2-digit"
/**
* The representation of the hour.
*/
hour?: "numeric" | "2-digit"
/**
* The representation of the minute.
*/
minute?: "numeric" | "2-digit"
/**
* The representation of the second.
*/
second?: "numeric" | "2-digit"
/**
* The representation of the time zone name.
*/
timeZoneName?: "long" | "short"
/**
* The format matching algorithm to use. Possible values are "basic" and "best fit"; the default is "best fit". See the following paragraphs for information about the use of this property.
* @default "best fit"
*/
formatMatcher?: "basic" | "best fit"
/**
* Whether to use 12-hour time (as opposed to 24-hour time). Possible values are true and false; the default is locale dependent. This option overrides the hc language tag and/or the hourCycle option in case both are present.
*/
hour12?: boolean
/**
* The time zone to use.
* The only value implementations must recognize is "UTC";
* the default is the runtime's default time zone.
* Implementations may also recognize the time zone names of the IANA time zone database,
* such as "Asia/Shanghai", "Asia/Kolkata", "America/New_York".
* @see https://www.iana.org/time-zones
*/
timeZone?: string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment