@octanejs/day-picker 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -0
  3. package/UPSTREAM.md +24 -0
  4. package/package.json +77 -0
  5. package/src/DayPicker.tsrx +717 -0
  6. package/src/UI.ts +121 -0
  7. package/src/classes/CalendarDay.ts +82 -0
  8. package/src/classes/CalendarMonth.ts +20 -0
  9. package/src/classes/CalendarWeek.ts +19 -0
  10. package/src/classes/DateLib.ts +695 -0
  11. package/src/classes/index.ts +4 -0
  12. package/src/components/custom-components.tsrx +237 -0
  13. package/src/formatters/formatCaption.ts +18 -0
  14. package/src/formatters/formatDay.ts +17 -0
  15. package/src/formatters/formatMonthDropdown.ts +16 -0
  16. package/src/formatters/formatWeekNumber.ts +19 -0
  17. package/src/formatters/formatWeekNumberHeader.ts +11 -0
  18. package/src/formatters/formatWeekdayName.ts +17 -0
  19. package/src/formatters/formatYearDropdown.ts +15 -0
  20. package/src/formatters/index.ts +7 -0
  21. package/src/helpers/calculateFocusTarget.ts +79 -0
  22. package/src/helpers/createGetModifiers.ts +117 -0
  23. package/src/helpers/endOfBroadcastWeek.ts +22 -0
  24. package/src/helpers/getBroadcastWeeksInMonth.ts +32 -0
  25. package/src/helpers/getClassNamesForModifiers.ts +38 -0
  26. package/src/helpers/getComponents.ts +19 -0
  27. package/src/helpers/getDataAttributes.ts +17 -0
  28. package/src/helpers/getDates.ts +87 -0
  29. package/src/helpers/getDays.ts +19 -0
  30. package/src/helpers/getDefaultClassNames.ts +36 -0
  31. package/src/helpers/getDisplayMonths.ts +30 -0
  32. package/src/helpers/getFocusableDate.ts +66 -0
  33. package/src/helpers/getFormatters.ts +16 -0
  34. package/src/helpers/getInitialMonth.ts +35 -0
  35. package/src/helpers/getLabels.ts +93 -0
  36. package/src/helpers/getMonthOptions.ts +45 -0
  37. package/src/helpers/getMonths.ts +89 -0
  38. package/src/helpers/getNavMonth.ts +35 -0
  39. package/src/helpers/getNextFocus.ts +45 -0
  40. package/src/helpers/getNextMonth.ts +46 -0
  41. package/src/helpers/getPreviousMonth.ts +45 -0
  42. package/src/helpers/getStyleForModifiers.ts +31 -0
  43. package/src/helpers/getWeekdays.ts +33 -0
  44. package/src/helpers/getWeeks.ts +14 -0
  45. package/src/helpers/getYearOptions.ts +43 -0
  46. package/src/helpers/index.ts +2 -0
  47. package/src/helpers/startOfBroadcastWeek.ts +26 -0
  48. package/src/helpers/useControlledValue.ts +38 -0
  49. package/src/index.ts +13 -0
  50. package/src/labels/index.ts +12 -0
  51. package/src/labels/labelDayButton.ts +29 -0
  52. package/src/labels/labelGrid.ts +18 -0
  53. package/src/labels/labelGridcell.ts +26 -0
  54. package/src/labels/labelMonthDropdown.ts +14 -0
  55. package/src/labels/labelNav.ts +11 -0
  56. package/src/labels/labelNext.ts +17 -0
  57. package/src/labels/labelPrevious.ts +13 -0
  58. package/src/labels/labelWeekNumber.ts +15 -0
  59. package/src/labels/labelWeekNumberHeader.ts +14 -0
  60. package/src/labels/labelWeekday.ts +16 -0
  61. package/src/labels/labelYearDropdown.ts +14 -0
  62. package/src/locale/af.ts +48 -0
  63. package/src/locale/ar-DZ.ts +48 -0
  64. package/src/locale/ar-EG.ts +48 -0
  65. package/src/locale/ar-MA.ts +48 -0
  66. package/src/locale/ar-SA.ts +48 -0
  67. package/src/locale/ar-TN.ts +48 -0
  68. package/src/locale/ar.ts +48 -0
  69. package/src/locale/az.ts +48 -0
  70. package/src/locale/be-tarask.ts +51 -0
  71. package/src/locale/be.ts +48 -0
  72. package/src/locale/bg.ts +48 -0
  73. package/src/locale/bn.ts +48 -0
  74. package/src/locale/bs.ts +48 -0
  75. package/src/locale/ca.ts +48 -0
  76. package/src/locale/ckb.ts +51 -0
  77. package/src/locale/cs.ts +48 -0
  78. package/src/locale/cy.ts +48 -0
  79. package/src/locale/da.ts +48 -0
  80. package/src/locale/de-AT.ts +48 -0
  81. package/src/locale/de.ts +48 -0
  82. package/src/locale/el.ts +48 -0
  83. package/src/locale/en-AU.ts +48 -0
  84. package/src/locale/en-CA.ts +48 -0
  85. package/src/locale/en-GB.ts +51 -0
  86. package/src/locale/en-IE.ts +48 -0
  87. package/src/locale/en-IN.ts +48 -0
  88. package/src/locale/en-NZ.ts +48 -0
  89. package/src/locale/en-US.ts +72 -0
  90. package/src/locale/en-ZA.ts +48 -0
  91. package/src/locale/eo.ts +48 -0
  92. package/src/locale/es.ts +48 -0
  93. package/src/locale/et.ts +48 -0
  94. package/src/locale/eu.ts +48 -0
  95. package/src/locale/fa-IR.ts +48 -0
  96. package/src/locale/fi.ts +48 -0
  97. package/src/locale/fr-CA.ts +48 -0
  98. package/src/locale/fr-CH.ts +48 -0
  99. package/src/locale/fr.ts +48 -0
  100. package/src/locale/fy.ts +48 -0
  101. package/src/locale/gd.ts +48 -0
  102. package/src/locale/gl.ts +48 -0
  103. package/src/locale/gu.ts +48 -0
  104. package/src/locale/he.ts +48 -0
  105. package/src/locale/hi.ts +48 -0
  106. package/src/locale/hr.ts +48 -0
  107. package/src/locale/ht.ts +48 -0
  108. package/src/locale/hu.ts +48 -0
  109. package/src/locale/hy.ts +48 -0
  110. package/src/locale/id.ts +48 -0
  111. package/src/locale/is.ts +48 -0
  112. package/src/locale/it-CH.ts +48 -0
  113. package/src/locale/it.ts +48 -0
  114. package/src/locale/ja-Hira.ts +48 -0
  115. package/src/locale/ja.ts +48 -0
  116. package/src/locale/ka.ts +48 -0
  117. package/src/locale/kk.ts +48 -0
  118. package/src/locale/km.ts +48 -0
  119. package/src/locale/kn.ts +48 -0
  120. package/src/locale/ko.ts +48 -0
  121. package/src/locale/lb.ts +48 -0
  122. package/src/locale/lt.ts +48 -0
  123. package/src/locale/lv.ts +48 -0
  124. package/src/locale/mk.ts +48 -0
  125. package/src/locale/mn.ts +48 -0
  126. package/src/locale/ms.ts +48 -0
  127. package/src/locale/mt.ts +48 -0
  128. package/src/locale/nb.ts +48 -0
  129. package/src/locale/nl-BE.ts +48 -0
  130. package/src/locale/nl.ts +48 -0
  131. package/src/locale/nn.ts +48 -0
  132. package/src/locale/oc.ts +48 -0
  133. package/src/locale/pl.ts +48 -0
  134. package/src/locale/pt-BR.ts +48 -0
  135. package/src/locale/pt.ts +48 -0
  136. package/src/locale/ro.ts +48 -0
  137. package/src/locale/ru.ts +48 -0
  138. package/src/locale/se.ts +48 -0
  139. package/src/locale/sk.ts +48 -0
  140. package/src/locale/sl.ts +48 -0
  141. package/src/locale/sq.ts +48 -0
  142. package/src/locale/sr-Latn.ts +48 -0
  143. package/src/locale/sr.ts +48 -0
  144. package/src/locale/sv.ts +48 -0
  145. package/src/locale/ta.ts +48 -0
  146. package/src/locale/te.ts +48 -0
  147. package/src/locale/th.ts +48 -0
  148. package/src/locale/tr.ts +48 -0
  149. package/src/locale/ug.ts +48 -0
  150. package/src/locale/uk.ts +48 -0
  151. package/src/locale/uz-Cyrl.ts +48 -0
  152. package/src/locale/uz.ts +48 -0
  153. package/src/locale/vi.ts +48 -0
  154. package/src/locale/zh-CN.ts +48 -0
  155. package/src/locale/zh-HK.ts +51 -0
  156. package/src/locale/zh-TW.ts +51 -0
  157. package/src/locale.ts +108 -0
  158. package/src/noonDateLib.ts +202 -0
  159. package/src/selection/useMulti.ts +74 -0
  160. package/src/selection/useRange.ts +89 -0
  161. package/src/selection/useSingle.ts +77 -0
  162. package/src/style.css +451 -0
  163. package/src/style.css.d.ts +3 -0
  164. package/src/style.module.css +451 -0
  165. package/src/style.module.css.d.ts +29 -0
  166. package/src/types/index.ts +3 -0
  167. package/src/types/props.ts +671 -0
  168. package/src/types/selection.ts +97 -0
  169. package/src/types/shared.ts +346 -0
  170. package/src/useAnimation.ts +242 -0
  171. package/src/useCalendar.ts +233 -0
  172. package/src/useDayPicker.ts +91 -0
  173. package/src/useFocus.ts +109 -0
  174. package/src/useSelection.ts +36 -0
  175. package/src/utils/addToRange.ts +91 -0
  176. package/src/utils/convertMatchersToTimeZone.ts +88 -0
  177. package/src/utils/dateMatchModifiers.ts +72 -0
  178. package/src/utils/index.ts +7 -0
  179. package/src/utils/rangeContainsDayOfWeek.ts +33 -0
  180. package/src/utils/rangeContainsModifiers.ts +106 -0
  181. package/src/utils/rangeIncludesDate.ts +40 -0
  182. package/src/utils/rangeOverlaps.ts +26 -0
  183. package/src/utils/toTimeZone.ts +13 -0
  184. package/src/utils/typeguards.ts +71 -0
  185. package/status.json +13 -0
@@ -0,0 +1,48 @@
1
+ import { ko as dateFnsKo } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Korean locale extended with DayPicker-specific translations. */
8
+ export const ko: DayPickerLocale = {
9
+ ...dateFnsKo,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `오늘, ${label}`;
20
+ if (modifiers.selected) label = `${label}, 선택됨`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: '월 선택',
24
+ labelNext: '다음 달로 이동',
25
+ labelPrevious: '이전 달로 이동',
26
+ labelWeekNumber: (weekNumber: number) => `주 ${weekNumber}`,
27
+ labelYearDropdown: '연도 선택',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `오늘, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: '탐색 모음',
44
+ labelWeekNumberHeader: '주 번호',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { lb as dateFnsLb } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Luxembourgish locale extended with DayPicker-specific translations. */
8
+ export const lb: DayPickerLocale = {
9
+ ...dateFnsLb,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Haut, ${label}`;
20
+ if (modifiers.selected) label = `${label}, ausgewielt`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Mount auswielen',
24
+ labelNext: 'Op de nächste Mount',
25
+ labelPrevious: 'Op de virdrun Mount',
26
+ labelWeekNumber: (weekNumber: number) => `Woch ${weekNumber}`,
27
+ labelYearDropdown: 'Joer auswielen',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Haut, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigatiounsbar',
44
+ labelWeekNumberHeader: 'Wochennummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { lt as dateFnsLt } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Lithuanian locale extended with DayPicker-specific translations. */
8
+ export const lt: DayPickerLocale = {
9
+ ...dateFnsLt,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Šiandien, ${label}`;
20
+ if (modifiers.selected) label = `${label}, pasirinkta`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Pasirinkite mėnesį',
24
+ labelNext: 'Pereiti į kitą mėnesį',
25
+ labelPrevious: 'Pereiti į ankstesnį mėnesį',
26
+ labelWeekNumber: (weekNumber: number) => `Savaitė ${weekNumber}`,
27
+ labelYearDropdown: 'Pasirinkite metus',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Šiandien, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Naršymo juosta',
44
+ labelWeekNumberHeader: 'Savaitės numeris',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { lv as dateFnsLv } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Latvian locale extended with DayPicker-specific translations. */
8
+ export const lv: DayPickerLocale = {
9
+ ...dateFnsLv,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Šodien, ${label}`;
20
+ if (modifiers.selected) label = `${label}, izvēlēts`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Izvēlieties mēnesi',
24
+ labelNext: 'Uz nākamo mēnesi',
25
+ labelPrevious: 'Uz iepriekšējo mēnesi',
26
+ labelWeekNumber: (weekNumber: number) => `Nedēļa ${weekNumber}`,
27
+ labelYearDropdown: 'Izvēlieties gadu',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Šodien, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigācijas josla',
44
+ labelWeekNumberHeader: 'Nedēļas numurs',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { mk as dateFnsMk } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Macedonian locale extended with DayPicker-specific translations. */
8
+ export const mk: DayPickerLocale = {
9
+ ...dateFnsMk,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Денес, ${label}`;
20
+ if (modifiers.selected) label = `${label}, избрано`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Изберете месец',
24
+ labelNext: 'Оди на следниот месец',
25
+ labelPrevious: 'Оди на претходниот месец',
26
+ labelWeekNumber: (weekNumber: number) => `Недела ${weekNumber}`,
27
+ labelYearDropdown: 'Изберете година',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Денес, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Лента за навигација',
44
+ labelWeekNumberHeader: 'Број на недела',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { mn as dateFnsMn } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Mongolian locale extended with DayPicker-specific translations. */
8
+ export const mn: DayPickerLocale = {
9
+ ...dateFnsMn,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Өнөөдөр, ${label}`;
20
+ if (modifiers.selected) label = `${label}, сонгогдсон`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Сараа сонгоно уу',
24
+ labelNext: 'Дараагийн сар руу очих',
25
+ labelPrevious: 'Өмнөх сар руу очих',
26
+ labelWeekNumber: (weekNumber: number) => `Долоо хоног ${weekNumber}`,
27
+ labelYearDropdown: 'Жилээ сонгоно уу',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Өнөөдөр, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Навигацийн самбар',
44
+ labelWeekNumberHeader: 'Долоо хонгийн дугаар',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { ms as dateFnsMs } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Malay locale extended with DayPicker-specific translations. */
8
+ export const ms: DayPickerLocale = {
9
+ ...dateFnsMs,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Hari ini, ${label}`;
20
+ if (modifiers.selected) label = `${label}, dipilih`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Pilih bulan',
24
+ labelNext: 'Pergi ke bulan seterusnya',
25
+ labelPrevious: 'Pergi ke bulan sebelumnya',
26
+ labelWeekNumber: (weekNumber: number) => `Minggu ${weekNumber}`,
27
+ labelYearDropdown: 'Pilih tahun',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Hari ini, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Bar navigasi',
44
+ labelWeekNumberHeader: 'Nombor minggu',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { mt as dateFnsMt } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Maltese locale extended with DayPicker-specific translations. */
8
+ export const mt: DayPickerLocale = {
9
+ ...dateFnsMt,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Illum, ${label}`;
20
+ if (modifiers.selected) label = `${label}, magħżul`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Agħżel ix-xahar',
24
+ labelNext: 'Mur għax-xahar li jmiss',
25
+ labelPrevious: "Mur għax-xahar ta' qabel",
26
+ labelWeekNumber: (weekNumber: number) => `Ġimgħa ${weekNumber}`,
27
+ labelYearDropdown: 'Agħżel is-sena',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Illum, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Bar tan-navigazzjoni',
44
+ labelWeekNumberHeader: 'Numru tal-ġimgħa',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { nb as dateFnsNb } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Norwegian Bokmål locale extended with DayPicker-specific translations. */
8
+ export const nb: DayPickerLocale = {
9
+ ...dateFnsNb,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `I dag, ${label}`;
20
+ if (modifiers.selected) label = `${label}, valgt`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Velg måned',
24
+ labelNext: 'Gå til neste måned',
25
+ labelPrevious: 'Gå til forrige måned',
26
+ labelWeekNumber: (weekNumber: number) => `Uke ${weekNumber}`,
27
+ labelYearDropdown: 'Velg år',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `I dag, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigasjonslinje',
44
+ labelWeekNumberHeader: 'Ukenummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { nlBE as dateFnsNlBE } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Dutch (Belgium) locale extended with DayPicker-specific translations. */
8
+ export const nlBE: DayPickerLocale = {
9
+ ...dateFnsNlBE,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Vandaag, ${label}`;
20
+ if (modifiers.selected) label = `${label}, geselecteerd`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Kies de maand',
24
+ labelNext: 'Ga naar volgende maand',
25
+ labelPrevious: 'Ga naar vorige maand',
26
+ labelWeekNumber: (weekNumber: number) => `Week ${weekNumber}`,
27
+ labelYearDropdown: 'Kies het jaar',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Vandaag, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigatiebalk',
44
+ labelWeekNumberHeader: 'Weeknummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { nl as dateFnsNl } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Dutch locale extended with DayPicker-specific translations. */
8
+ export const nl: DayPickerLocale = {
9
+ ...dateFnsNl,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Vandaag, ${label}`;
20
+ if (modifiers.selected) label = `${label}, geselecteerd`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Kies de maand',
24
+ labelNext: 'Ga naar volgende maand',
25
+ labelPrevious: 'Ga naar vorige maand',
26
+ labelWeekNumber: (weekNumber: number) => `Week ${weekNumber}`,
27
+ labelYearDropdown: 'Kies het jaar',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Vandaag, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigatiebalk',
44
+ labelWeekNumberHeader: 'Weeknummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { nn as dateFnsNn } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Norwegian Nynorsk locale extended with DayPicker-specific translations. */
8
+ export const nn: DayPickerLocale = {
9
+ ...dateFnsNn,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `I dag, ${label}`;
20
+ if (modifiers.selected) label = `${label}, vald`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Vel månad',
24
+ labelNext: 'Gå til neste månad',
25
+ labelPrevious: 'Gå til førre månad',
26
+ labelWeekNumber: (weekNumber: number) => `Veke ${weekNumber}`,
27
+ labelYearDropdown: 'Vel år',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `I dag, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigasjonslinje',
44
+ labelWeekNumberHeader: 'Vekenummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { oc as dateFnsOc } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Occitan locale extended with DayPicker-specific translations. */
8
+ export const oc: DayPickerLocale = {
9
+ ...dateFnsOc,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Uèi, ${label}`;
20
+ if (modifiers.selected) label = `${label}, seleccionat`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Causissètz lo mes',
24
+ labelNext: 'Anar al mes que ven',
25
+ labelPrevious: 'Anar al mes precedent',
26
+ labelWeekNumber: (weekNumber: number) => `Setmana ${weekNumber}`,
27
+ labelYearDropdown: "Causissètz l'annada",
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Uèi, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Barra de navigacion',
44
+ labelWeekNumberHeader: 'Numèro de setmana',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { pl as dateFnsPl } from 'date-fns/locale';
2
+
3
+ import type { DateLibOptions, DayPickerLocale } from '../classes/DateLib.js';
4
+ import { DateLib } from '../classes/DateLib.js';
5
+ import type { Modifiers } from '../types/index.js';
6
+
7
+ /** Polish locale extended with DayPicker-specific translations. */
8
+ export const pl: DayPickerLocale = {
9
+ ...dateFnsPl,
10
+ labels: {
11
+ labelDayButton: (
12
+ date: Date,
13
+ modifiers: Modifiers,
14
+ options?: DateLibOptions,
15
+ dateLib?: DateLib,
16
+ ) => {
17
+ const lib = dateLib ?? new DateLib(options);
18
+ let label = lib.format(date, 'PPPP');
19
+ if (modifiers.today) label = `Dziś, ${label}`;
20
+ if (modifiers.selected) label = `${label}, zaznaczony`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Wybierz miesiąc',
24
+ labelNext: 'Przejdź do następnego miesiąca',
25
+ labelPrevious: 'Przejdź do poprzedniego miesiąca',
26
+ labelWeekNumber: (weekNumber: number) => `Tydzień ${weekNumber}`,
27
+ labelYearDropdown: 'Wybierz rok',
28
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
29
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
30
+ labelGridcell: (
31
+ date: Date,
32
+ modifiers?: Modifiers,
33
+ options?: DateLibOptions,
34
+ dateLib?: DateLib,
35
+ ) => {
36
+ const lib = dateLib ?? new DateLib(options);
37
+ let label = lib.format(date, 'PPPP');
38
+ if (modifiers?.today) {
39
+ label = `Dziś, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Pasek nawigacyjny',
44
+ labelWeekNumberHeader: 'Numer tygodnia',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };