@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 { arSA as dateFnsArSA } 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
+ /** Arabic (Saudi Arabia) locale extended with DayPicker-specific translations. */
8
+ export const arSA: DayPickerLocale = {
9
+ ...dateFnsArSA,
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 { arTN as dateFnsArTN } 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
+ /** Arabic (Tunisia) locale extended with DayPicker-specific translations. */
8
+ export const arTN: DayPickerLocale = {
9
+ ...dateFnsArTN,
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 { ar as dateFnsAr } 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
+ /** Arabic locale extended with DayPicker-specific translations. */
8
+ export const ar: DayPickerLocale = {
9
+ ...dateFnsAr,
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 { az as dateFnsAz } 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
+ /** Azerbaijani locale extended with DayPicker-specific translations. */
8
+ export const az: DayPickerLocale = {
9
+ ...dateFnsAz,
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 = `Bu gün, ${label}`;
20
+ if (modifiers.selected) label = `${label}, seçilmiş`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Ayı seçin',
24
+ labelNext: 'Növbəti aya keç',
25
+ labelPrevious: 'Əvvəlki aya keç',
26
+ labelWeekNumber: (weekNumber: number) => `Həftə ${weekNumber}`,
27
+ labelYearDropdown: 'İli seçin',
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 = `Bu gün, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Naviqasiya paneli',
44
+ labelWeekNumberHeader: 'Həftə nömrəsi',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,51 @@
1
+ import { beTarask as dateFnsBeTarask } 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
+ /**
8
+ * Belarusian (Taraskievica) locale extended with DayPicker-specific
9
+ * translations.
10
+ */
11
+ export const beTarask: DayPickerLocale = {
12
+ ...dateFnsBeTarask,
13
+ labels: {
14
+ labelDayButton: (
15
+ date: Date,
16
+ modifiers: Modifiers,
17
+ options?: DateLibOptions,
18
+ dateLib?: DateLib,
19
+ ) => {
20
+ const lib = dateLib ?? new DateLib(options);
21
+ let label = lib.format(date, 'PPPP');
22
+ if (modifiers.today) label = `Сёньня, ${label}`;
23
+ if (modifiers.selected) label = `${label}, абрана`;
24
+ return label;
25
+ },
26
+ labelMonthDropdown: 'Выберыце месяц',
27
+ labelNext: 'Перайсьці да наступнага месяца',
28
+ labelPrevious: 'Перайсьці да папярэдняга месяца',
29
+ labelWeekNumber: (weekNumber: number) => `Тыдзень ${weekNumber}`,
30
+ labelYearDropdown: 'Выберыце год',
31
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
32
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
33
+ labelGridcell: (
34
+ date: Date,
35
+ modifiers?: Modifiers,
36
+ options?: DateLibOptions,
37
+ dateLib?: DateLib,
38
+ ) => {
39
+ const lib = dateLib ?? new DateLib(options);
40
+ let label = lib.format(date, 'PPPP');
41
+ if (modifiers?.today) {
42
+ label = `Сёньня, ${label}`;
43
+ }
44
+ return label;
45
+ },
46
+ labelNav: 'Панэль навігацыі',
47
+ labelWeekNumberHeader: 'Нумар тыдня',
48
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
49
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
50
+ },
51
+ };
@@ -0,0 +1,48 @@
1
+ import { be as dateFnsBe } 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
+ /** Belarusian locale extended with DayPicker-specific translations. */
8
+ export const be: DayPickerLocale = {
9
+ ...dateFnsBe,
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 { bg as dateFnsBg } 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
+ /** Bulgarian locale extended with DayPicker-specific translations. */
8
+ export const bg: DayPickerLocale = {
9
+ ...dateFnsBg,
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 { bn as dateFnsBn } 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
+ /** Bengali locale extended with DayPicker-specific translations. */
8
+ export const bn: DayPickerLocale = {
9
+ ...dateFnsBn,
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 { bs as dateFnsBs } 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
+ /** Bosnian locale extended with DayPicker-specific translations. */
8
+ export const bs: DayPickerLocale = {
9
+ ...dateFnsBs,
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}, odabrano`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Odaberite mjesec',
24
+ labelNext: 'Idi na sljedeći mjesec',
25
+ labelPrevious: 'Idi na prethodni mjesec',
26
+ labelWeekNumber: (weekNumber: number) => `Sedmica ${weekNumber}`,
27
+ labelYearDropdown: 'Odaberite 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: 'Navigacijska traka',
44
+ labelWeekNumberHeader: 'Broj sedmice',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { ca as dateFnsCa } 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
+ /** Catalan locale extended with DayPicker-specific translations. */
8
+ export const ca: DayPickerLocale = {
9
+ ...dateFnsCa,
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 = `Avui, ${label}`;
20
+ if (modifiers.selected) label = `${label}, seleccionat`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Tria el mes',
24
+ labelNext: 'Ves al mes següent',
25
+ labelPrevious: 'Ves al mes anterior',
26
+ labelWeekNumber: (weekNumber: number) => `Setmana ${weekNumber}`,
27
+ labelYearDropdown: "Tria l'any",
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 = `Avui, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Barra de navegació',
44
+ labelWeekNumberHeader: 'Número de setmana',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,51 @@
1
+ import { ckb as dateFnsCkb } 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
+ /**
8
+ * Central Kurdish (Sorani) locale extended with DayPicker-specific
9
+ * translations.
10
+ */
11
+ export const ckb: DayPickerLocale = {
12
+ ...dateFnsCkb,
13
+ labels: {
14
+ labelDayButton: (
15
+ date: Date,
16
+ modifiers: Modifiers,
17
+ options?: DateLibOptions,
18
+ dateLib?: DateLib,
19
+ ) => {
20
+ const lib = dateLib ?? new DateLib(options);
21
+ let label = lib.format(date, 'PPPP');
22
+ if (modifiers.today) label = `ئەمڕۆ، ${label}`;
23
+ if (modifiers.selected) label = `${label}، هەڵبژێرا`;
24
+ return label;
25
+ },
26
+ labelMonthDropdown: 'مانگ هەڵبژێرە',
27
+ labelNext: 'بڕۆ بۆ مانگی داهاتوو',
28
+ labelPrevious: 'بڕۆ بۆ مانگی پێشوو',
29
+ labelWeekNumber: (weekNumber: number) => `هەفتە ${weekNumber}`,
30
+ labelYearDropdown: 'ساڵ هەڵبژێرە',
31
+ labelGrid: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
32
+ (dateLib ?? new DateLib(options)).formatMonthYear(date),
33
+ labelGridcell: (
34
+ date: Date,
35
+ modifiers?: Modifiers,
36
+ options?: DateLibOptions,
37
+ dateLib?: DateLib,
38
+ ) => {
39
+ const lib = dateLib ?? new DateLib(options);
40
+ let label = lib.format(date, 'PPPP');
41
+ if (modifiers?.today) {
42
+ label = `ئەمڕۆ، ${label}`;
43
+ }
44
+ return label;
45
+ },
46
+ labelNav: 'شریتی ڕاڕەوێژ',
47
+ labelWeekNumberHeader: 'ژمارەی هەفتە',
48
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
49
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
50
+ },
51
+ };
@@ -0,0 +1,48 @@
1
+ import { cs as dateFnsCs } 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
+ /** Czech locale extended with DayPicker-specific translations. */
8
+ export const cs: DayPickerLocale = {
9
+ ...dateFnsCs,
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}, vybráno`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Vyberte měsíc',
24
+ labelNext: 'Přejít na další měsíc',
25
+ labelPrevious: 'Přejít na předchozí měsíc',
26
+ labelWeekNumber: (weekNumber: number) => `Týden ${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ýdne',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ import { cy as dateFnsCy } 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
+ /** Welsh locale extended with DayPicker-specific translations. */
8
+ export const cy: DayPickerLocale = {
9
+ ...dateFnsCy,
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 = `Heddiw, ${label}`;
20
+ if (modifiers.selected) label = `${label}, wedi'i ddewis`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: 'Dewiswch y mis',
24
+ labelNext: "Ewch i'r mis nesaf",
25
+ labelPrevious: "Ewch i'r mis blaenorol",
26
+ labelWeekNumber: (weekNumber: number) => `Wythnos ${weekNumber}`,
27
+ labelYearDropdown: 'Dewiswch y flwyddyn',
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 = `Heddiw, ${label}`;
40
+ }
41
+ return label;
42
+ },
43
+ labelNav: 'Bar llywio',
44
+ labelWeekNumberHeader: 'Rhif yr wythnos',
45
+ labelWeekday: (date: Date, options?: DateLibOptions, dateLib?: DateLib) =>
46
+ (dateLib ?? new DateLib(options)).format(date, 'cccc'),
47
+ },
48
+ };