aboutsummaryrefslogtreecommitdiff
path: root/src/definitions/date.ts
blob: 1a3d073bab986209edda35dfe733ba9dce9edb9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import type { LocaleEntry } from './definitions';

/**
 * The possible definitions related to dates.
 */
export type DateDefinition = LocaleEntry<{
  /**
   * The translations for months (January - December).
   */
  month: DateEntryDefinition;

  /**
   * The translations for weekdays (Sunday - Saturday).
   */
  weekday: DateEntryDefinition;

  /**
   * The names of the IANA time zones. Not tied to the current locale.
   *
   * Since this is the same for all locales, it is only defined in the `base` locale.
   *
   * @see [IANA Time Zone Database](https://www.iana.org/time-zones)
   */
  time_zone: string[];
}>;

/**
 * The possible definitions related to date entries.
 */
export interface DateEntryDefinition {
  /**
   * The long name of the entry.
   */
  wide: string[];

  /**
   * The short name/abbreviation of the entry.
   * If null, the locale does not support a short name/abbreviation for the entry.
   */
  abbr: string[] | null;

  /**
   * The wide name of the entry when used in context. If absent wide will be used instead.
   * It is used to specify a word in context, which may differ from a stand-alone word.
   */
  wide_context?: string[];

  /**
   * The short name/abbreviation name of the entry when used in context. If absent abbr will be used instead.
   * It is used to specify a word in context, which may differ from a stand-alone word.
   */
  abbr_context?: string[];
}