@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 { ptBR as dateFnsPtBR } 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
+ /** Portuguese (Brazil) locale extended with DayPicker-specific translations. */
8
+ export const ptBR: DayPickerLocale = {
9
+ ...dateFnsPtBR,
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 = `Hoje, ${label}`;
20
+ if (modifiers.selected) label = `${label}, selecionado`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Escolha o mês',
24
+ labelNext: 'Ir para o próximo mês',
25
+ labelPrevious: 'Ir para o mês anterior',
26
+ labelWeekNumber: (weekNumber: number) => `Semana ${weekNumber}`,
27
+ labelYearDropdown: 'Escolha o ano',
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 = `Hoje, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Barra de navegação',
44
+ labelWeekNumberHeader: 'Número da semana',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { pt as dateFnsPt } 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
+ /** Portuguese locale extended with DayPicker-specific translations. */
8
+ export const pt: DayPickerLocale = {
9
+ ...dateFnsPt,
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 = `Hoje, ${label}`;
20
+ if (modifiers.selected) label = `${label}, selecionado`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Escolha o mês',
24
+ labelNext: 'Ir para o próximo mês',
25
+ labelPrevious: 'Ir para o mês anterior',
26
+ labelWeekNumber: (weekNumber: number) => `Semana ${weekNumber}`,
27
+ labelYearDropdown: 'Escolha o ano',
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 = `Hoje, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Barra de navegação',
44
+ labelWeekNumberHeader: 'Número da semana',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { ro as dateFnsRo } 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
+ /** Romanian locale extended with DayPicker-specific translations. */
8
+ export const ro: DayPickerLocale = {
9
+ ...dateFnsRo,
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 = `Astăzi, ${label}`;
20
+ if (modifiers.selected) label = `${label}, selectat`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Alege luna',
24
+ labelNext: 'Mergi la luna următoare',
25
+ labelPrevious: 'Mergi la luna anterioară',
26
+ labelWeekNumber: (weekNumber: number) => `Săptămâna ${weekNumber}`,
27
+ labelYearDropdown: 'Alege anul',
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 = `Astăzi, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Bară de navigare',
44
+ labelWeekNumberHeader: 'Numărul săptămânii',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { ru as dateFnsRu } 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
+ /** Russian locale extended with DayPicker-specific translations. */
8
+ export const ru: DayPickerLocale = {
9
+ ...dateFnsRu,
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 { se as dateFnsSe } 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
+ /** Northern Sami locale extended with DayPicker-specific translations. */
8
+ export const se: DayPickerLocale = {
9
+ ...dateFnsSe,
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 = `Odne, ${label}`;
20
+ if (modifiers.selected) label = `${label}, válljejuvvon`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Vállje mánnu',
24
+ labelNext: 'Mana boahtte mánu',
25
+ labelPrevious: 'Mana ovddit mánu',
26
+ labelWeekNumber: (weekNumber: number) => `Vahkku ${weekNumber}`,
27
+ labelYearDropdown: 'Vállje jahki',
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 = `Odne, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigasuvnnabár',
44
+ labelWeekNumberHeader: 'Vahkku lohku',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { sk as dateFnsSk } 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
+ /** Slovak locale extended with DayPicker-specific translations. */
8
+ export const sk: DayPickerLocale = {
9
+ ...dateFnsSk,
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 = `Dnes, ${label}`;
20
+ if (modifiers.selected) label = `${label}, vybraté`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Vyberte mesiac',
24
+ labelNext: 'Prejsť na ďalší mesiac',
25
+ labelPrevious: 'Prejsť na predchádzajúci mesiac',
26
+ labelWeekNumber: (weekNumber: number) => `Týždeň ${weekNumber}`,
27
+ labelYearDropdown: 'Vyberte 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 = `Dnes, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigačný panel',
44
+ labelWeekNumberHeader: 'Číslo týždň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 { sl as dateFnsSl } 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
+ /** Slovene locale extended with DayPicker-specific translations. */
8
+ export const sl: DayPickerLocale = {
9
+ ...dateFnsSl,
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 = `Danes, ${label}`;
20
+ if (modifiers.selected) label = `${label}, izbrano`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Izberite mesec',
24
+ labelNext: 'Pojdi na naslednji mesec',
25
+ labelPrevious: 'Pojdi na prejšnji mesec',
26
+ labelWeekNumber: (weekNumber: number) => `Teden ${weekNumber}`,
27
+ labelYearDropdown: 'Izberite leto',
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 = `Danes, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigacijska vrstica',
44
+ labelWeekNumberHeader: 'Številka tedna',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { sq as dateFnsSq } 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
+ /** Albanian locale extended with DayPicker-specific translations. */
8
+ export const sq: DayPickerLocale = {
9
+ ...dateFnsSq,
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 = `Sot, ${label}`;
20
+ if (modifiers.selected) label = `${label}, zgjedhur`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Zgjidhni muajin',
24
+ labelNext: 'Shko te muaji tjetër',
25
+ labelPrevious: 'Shko te muaji i mëparshëm',
26
+ labelWeekNumber: (weekNumber: number) => `Java ${weekNumber}`,
27
+ labelYearDropdown: 'Zgjidhni vitin',
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 = `Sot, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Shiriti i navigimit',
44
+ labelWeekNumberHeader: 'Numri i javës',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { srLatn as dateFnsSrLatn } 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
+ /** Serbian (Latin) locale extended with DayPicker-specific translations. */
8
+ export const srLatn: DayPickerLocale = {
9
+ ...dateFnsSrLatn,
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 = `Danas, ${label}`;
20
+ if (modifiers.selected) label = `${label}, izabrano`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Izaberite mesec',
24
+ labelNext: 'Idite na sledeći mesec',
25
+ labelPrevious: 'Idite na prethodni mesec',
26
+ labelWeekNumber: (weekNumber: number) => `Nedelja ${weekNumber}`,
27
+ labelYearDropdown: 'Izaberite godinu',
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 = `Danas, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigaciona traka',
44
+ labelWeekNumberHeader: 'Broj nedelje',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { sr as dateFnsSr } 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
+ /** Serbian (Cyrillic) locale extended with DayPicker-specific translations. */
8
+ export const sr: DayPickerLocale = {
9
+ ...dateFnsSr,
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 { sv as dateFnsSv } 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
+ /** Swedish locale extended with DayPicker-specific translations. */
8
+ export const sv: DayPickerLocale = {
9
+ ...dateFnsSv,
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 = `Idag, ${label}`;
20
+ if (modifiers.selected) label = `${label}, vald`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Välj månad',
24
+ labelNext: 'Gå till nästa månad',
25
+ labelPrevious: 'Gå till föregående månad',
26
+ labelWeekNumber: (weekNumber: number) => `Vecka ${weekNumber}`,
27
+ labelYearDropdown: 'Välj å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 = `Idag, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Navigationsfält',
44
+ labelWeekNumberHeader: 'Veckonummer',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { ta as dateFnsTa } 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
+ /** Tamil locale extended with DayPicker-specific translations. */
8
+ export const ta: DayPickerLocale = {
9
+ ...dateFnsTa,
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 { te as dateFnsTe } 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
+ /** Telugu locale extended with DayPicker-specific translations. */
8
+ export const te: DayPickerLocale = {
9
+ ...dateFnsTe,
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 { th as dateFnsTh } 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
+ /** Thai locale extended with DayPicker-specific translations. */
8
+ export const th: DayPickerLocale = {
9
+ ...dateFnsTh,
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
+ };