react-native-bikram-sambat 0.1.0 → 0.1.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 (156) hide show
  1. package/README.md +18 -0
  2. package/docs/screenshots/iphone-15-pro-max-calendar.png +0 -0
  3. package/lib/commonjs/accessibility/index.js +1 -1
  4. package/lib/commonjs/accessibility/labels.js +2 -2
  5. package/lib/commonjs/accessibility/labels.js.map +1 -1
  6. package/lib/commonjs/calendar/get-calendar-month-grid.js +5 -5
  7. package/lib/commonjs/calendar/index.js +1 -1
  8. package/lib/commonjs/components/NepaliCalendar/CalendarDay.js +2 -2
  9. package/lib/commonjs/components/NepaliCalendar/CalendarDay.js.map +1 -1
  10. package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js +5 -5
  11. package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js.map +1 -1
  12. package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js +8 -8
  13. package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js.map +1 -1
  14. package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js +37 -37
  15. package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js.map +1 -1
  16. package/lib/commonjs/components/NepaliCalendar/index.js +1 -1
  17. package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js +7 -7
  18. package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js.map +1 -1
  19. package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js +9 -9
  20. package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -1
  21. package/lib/commonjs/components/NepaliDatePicker/index.js +2 -2
  22. package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js +12 -12
  23. package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -1
  24. package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js +12 -12
  25. package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js.map +1 -1
  26. package/lib/commonjs/components/NepaliRangePicker/index.js +3 -3
  27. package/lib/commonjs/components/NepaliRangePicker/range-utils.js +7 -7
  28. package/lib/commonjs/components/NepaliRangePicker/range-utils.js.map +1 -1
  29. package/lib/commonjs/core/arithmetic.js +3 -3
  30. package/lib/commonjs/core/bsData.js +1 -1
  31. package/lib/commonjs/core/conversion.js +3 -3
  32. package/lib/commonjs/core/dateKey.js +1 -1
  33. package/lib/commonjs/core/format/format.js +9 -9
  34. package/lib/commonjs/core/format/format.js.map +1 -1
  35. package/lib/commonjs/core/format/index.js +2 -2
  36. package/lib/commonjs/core/format/parse.js +3 -3
  37. package/lib/commonjs/core/format/parse.js.map +1 -1
  38. package/lib/commonjs/core/index.js +19 -19
  39. package/lib/commonjs/core/index.js.map +1 -1
  40. package/lib/commonjs/core/locale/index.js +2 -2
  41. package/lib/commonjs/core/numerals/index.js +1 -1
  42. package/lib/commonjs/core/validation.js +2 -2
  43. package/lib/commonjs/index.js +32 -32
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/theme/create-theme.js +1 -1
  46. package/lib/commonjs/theme/index.js +2 -2
  47. package/lib/commonjs/utils/date-helpers.js +4 -4
  48. package/lib/commonjs/utils/date-helpers.js.map +1 -1
  49. package/lib/commonjs/utils/index.js +1 -1
  50. package/lib/module/accessibility/index.js +1 -1
  51. package/lib/module/accessibility/index.js.map +1 -1
  52. package/lib/module/accessibility/labels.js +1 -1
  53. package/lib/module/accessibility/labels.js.map +1 -1
  54. package/lib/module/calendar/get-calendar-month-grid.js +6 -6
  55. package/lib/module/calendar/get-calendar-month-grid.js.map +1 -1
  56. package/lib/module/calendar/index.js +1 -1
  57. package/lib/module/calendar/index.js.map +1 -1
  58. package/lib/module/components/NepaliCalendar/CalendarDay.js +1 -1
  59. package/lib/module/components/NepaliCalendar/CalendarDay.js.map +1 -1
  60. package/lib/module/components/NepaliCalendar/CalendarGrid.js +3 -3
  61. package/lib/module/components/NepaliCalendar/CalendarGrid.js.map +1 -1
  62. package/lib/module/components/NepaliCalendar/CalendarHeader.js +4 -4
  63. package/lib/module/components/NepaliCalendar/CalendarHeader.js.map +1 -1
  64. package/lib/module/components/NepaliCalendar/NepaliCalendar.js +8 -8
  65. package/lib/module/components/NepaliCalendar/NepaliCalendar.js.map +1 -1
  66. package/lib/module/components/NepaliCalendar/index.js +1 -1
  67. package/lib/module/components/NepaliCalendar/index.js.map +1 -1
  68. package/lib/module/components/NepaliDatePicker/DatePickerModal.js +3 -3
  69. package/lib/module/components/NepaliDatePicker/DatePickerModal.js.map +1 -1
  70. package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js +4 -4
  71. package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -1
  72. package/lib/module/components/NepaliDatePicker/index.js +2 -2
  73. package/lib/module/components/NepaliDatePicker/index.js.map +1 -1
  74. package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js +4 -4
  75. package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -1
  76. package/lib/module/components/NepaliRangePicker/RangePickerModal.js +4 -4
  77. package/lib/module/components/NepaliRangePicker/RangePickerModal.js.map +1 -1
  78. package/lib/module/components/NepaliRangePicker/index.js +3 -3
  79. package/lib/module/components/NepaliRangePicker/index.js.map +1 -1
  80. package/lib/module/components/NepaliRangePicker/range-utils.js +1 -1
  81. package/lib/module/components/NepaliRangePicker/range-utils.js.map +1 -1
  82. package/lib/module/core/arithmetic.js +3 -3
  83. package/lib/module/core/arithmetic.js.map +1 -1
  84. package/lib/module/core/bsData.js +1 -1
  85. package/lib/module/core/bsData.js.map +1 -1
  86. package/lib/module/core/conversion.js +3 -3
  87. package/lib/module/core/conversion.js.map +1 -1
  88. package/lib/module/core/dateKey.js +1 -1
  89. package/lib/module/core/dateKey.js.map +1 -1
  90. package/lib/module/core/format/format.js +6 -6
  91. package/lib/module/core/format/format.js.map +1 -1
  92. package/lib/module/core/format/index.js +2 -2
  93. package/lib/module/core/format/index.js.map +1 -1
  94. package/lib/module/core/format/parse.js +2 -2
  95. package/lib/module/core/format/parse.js.map +1 -1
  96. package/lib/module/core/index.js +10 -10
  97. package/lib/module/core/index.js.map +1 -1
  98. package/lib/module/core/locale/index.js +2 -2
  99. package/lib/module/core/locale/index.js.map +1 -1
  100. package/lib/module/core/numerals/index.js +1 -1
  101. package/lib/module/core/numerals/index.js.map +1 -1
  102. package/lib/module/core/validation.js +2 -2
  103. package/lib/module/core/validation.js.map +1 -1
  104. package/lib/module/index.js +8 -8
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/theme/create-theme.js +1 -1
  107. package/lib/module/theme/create-theme.js.map +1 -1
  108. package/lib/module/theme/index.js +2 -2
  109. package/lib/module/theme/index.js.map +1 -1
  110. package/lib/module/utils/date-helpers.js +2 -2
  111. package/lib/module/utils/date-helpers.js.map +1 -1
  112. package/lib/module/utils/index.js +1 -1
  113. package/lib/module/utils/index.js.map +1 -1
  114. package/package.json +41 -9
  115. package/lib/commonjs/core/validation.test.js +0 -248
  116. package/lib/commonjs/core/validation.test.js.map +0 -1
  117. package/lib/commonjs/exports.test.js +0 -133
  118. package/lib/commonjs/exports.test.js.map +0 -1
  119. package/lib/commonjs/package.json +0 -1
  120. package/lib/commonjs/phase2.test.js +0 -446
  121. package/lib/commonjs/phase2.test.js.map +0 -1
  122. package/lib/commonjs/phase3.test.js +0 -91
  123. package/lib/commonjs/phase3.test.js.map +0 -1
  124. package/lib/commonjs/phase4.test.js +0 -89
  125. package/lib/commonjs/phase4.test.js.map +0 -1
  126. package/lib/commonjs/phase5.test.js +0 -246
  127. package/lib/commonjs/phase5.test.js.map +0 -1
  128. package/lib/commonjs/phase7.test.js +0 -284
  129. package/lib/commonjs/phase7.test.js.map +0 -1
  130. package/lib/commonjs/range-helpers.test.js +0 -182
  131. package/lib/commonjs/range-helpers.test.js.map +0 -1
  132. package/lib/module/core/validation.test.js +0 -248
  133. package/lib/module/core/validation.test.js.map +0 -1
  134. package/lib/module/exports.test.js +0 -133
  135. package/lib/module/exports.test.js.map +0 -1
  136. package/lib/module/package.json +0 -1
  137. package/lib/module/phase2.test.js +0 -446
  138. package/lib/module/phase2.test.js.map +0 -1
  139. package/lib/module/phase3.test.js +0 -91
  140. package/lib/module/phase3.test.js.map +0 -1
  141. package/lib/module/phase4.test.js +0 -89
  142. package/lib/module/phase4.test.js.map +0 -1
  143. package/lib/module/phase5.test.js +0 -246
  144. package/lib/module/phase5.test.js.map +0 -1
  145. package/lib/module/phase7.test.js +0 -284
  146. package/lib/module/phase7.test.js.map +0 -1
  147. package/lib/module/range-helpers.test.js +0 -182
  148. package/lib/module/range-helpers.test.js.map +0 -1
  149. package/src/core/validation.test.ts +0 -207
  150. package/src/exports.test.ts +0 -135
  151. package/src/phase2.test.ts +0 -424
  152. package/src/phase3.test.ts +0 -83
  153. package/src/phase4.test.ts +0 -86
  154. package/src/phase5.test.ts +0 -257
  155. package/src/phase7.test.ts +0 -307
  156. package/src/range-helpers.test.ts +0 -153
@@ -1,153 +0,0 @@
1
- import {
2
- isBSDateInSupportedRange,
3
- clampBSDateToSupportedRange,
4
- getDefaultSupportedBSDate,
5
- getSafeCalendarMonth,
6
- SUPPORTED_BS_START_YEAR,
7
- SUPPORTED_BS_END_YEAR,
8
- getSupportedBSRange,
9
- } from './core';
10
-
11
- describe('supported range helpers', () => {
12
- it('exports start and end year constants', () => {
13
- expect(SUPPORTED_BS_START_YEAR).toBe(2081);
14
- expect(SUPPORTED_BS_END_YEAR).toBe(2081);
15
- });
16
-
17
- it('getSupportedBSRange returns correct range', () => {
18
- const range = getSupportedBSRange();
19
- expect(range).toEqual({ start: 2081, end: 2081 });
20
- });
21
- });
22
-
23
- describe('isBSDateInSupportedRange', () => {
24
- it('returns true for dates inside supported range', () => {
25
- expect(
26
- isBSDateInSupportedRange({ calendar: 'BS', year: 2081, month: 1, day: 1 })
27
- ).toBe(true);
28
- expect(
29
- isBSDateInSupportedRange({ calendar: 'BS', year: 2081, month: 12, day: 30 })
30
- ).toBe(true);
31
- });
32
-
33
- it('returns false for dates outside supported range', () => {
34
- expect(
35
- isBSDateInSupportedRange({ calendar: 'BS', year: 2080, month: 1, day: 1 })
36
- ).toBe(false);
37
- expect(
38
- isBSDateInSupportedRange({ calendar: 'BS', year: 2082, month: 1, day: 1 })
39
- ).toBe(false);
40
- });
41
-
42
- it('returns false for invalid calendar', () => {
43
- expect(
44
- isBSDateInSupportedRange({ calendar: 'AD' as any, year: 2081, month: 1, day: 1 })
45
- ).toBe(false);
46
- });
47
- });
48
-
49
- describe('clampBSDateToSupportedRange', () => {
50
- it('returns same date when already in range', () => {
51
- const date = { calendar: 'BS' as const, year: 2081, month: 6, day: 15 };
52
- expect(clampBSDateToSupportedRange(date)).toEqual(date);
53
- });
54
-
55
- it('clamps year below range to start year month 1 day 1', () => {
56
- const result = clampBSDateToSupportedRange({
57
- calendar: 'BS',
58
- year: 2080,
59
- month: 6,
60
- day: 15,
61
- });
62
- expect(result.year).toBe(2081);
63
- expect(result.month).toBe(1);
64
- expect(result.day).toBe(1);
65
- });
66
-
67
- it('clamps year above range to end year month 12 day 30', () => {
68
- const result = clampBSDateToSupportedRange({
69
- calendar: 'BS',
70
- year: 2082,
71
- month: 6,
72
- day: 15,
73
- });
74
- expect(result.year).toBe(2081);
75
- expect(result.month).toBe(12);
76
- expect(result.day).toBe(30);
77
- });
78
-
79
- it('clamps month to valid range', () => {
80
- const result = clampBSDateToSupportedRange({
81
- calendar: 'BS',
82
- year: 2081,
83
- month: 13,
84
- day: 1,
85
- });
86
- expect(result.month).toBe(12);
87
- });
88
-
89
- it('clamps day to valid month length', () => {
90
- const result = clampBSDateToSupportedRange({
91
- calendar: 'BS',
92
- year: 2081,
93
- month: 8,
94
- day: 30,
95
- });
96
- expect(result.day).toBe(29);
97
- });
98
- });
99
-
100
- describe('getDefaultSupportedBSDate', () => {
101
- it('returns first day of first supported year', () => {
102
- const date = getDefaultSupportedBSDate();
103
- expect(date).toEqual({
104
- calendar: 'BS',
105
- year: 2081,
106
- month: 1,
107
- day: 1,
108
- });
109
- });
110
- });
111
-
112
- describe('getSafeCalendarMonth', () => {
113
- it('uses value when in supported range', () => {
114
- const result = getSafeCalendarMonth({
115
- value: { calendar: 'BS', year: 2081, month: 5, day: 10 },
116
- });
117
- expect(result).toEqual({ year: 2081, month: 5 });
118
- });
119
-
120
- it('uses defaultValue when value is null', () => {
121
- const result = getSafeCalendarMonth({
122
- value: null,
123
- defaultValue: { calendar: 'BS', year: 2081, month: 3, day: 1 },
124
- });
125
- expect(result).toEqual({ year: 2081, month: 3 });
126
- });
127
-
128
- it('uses year/month when in supported range', () => {
129
- const result = getSafeCalendarMonth({
130
- year: 2081,
131
- month: 7,
132
- });
133
- expect(result).toEqual({ year: 2081, month: 7 });
134
- });
135
-
136
- it('falls back to supported range when year is out of range', () => {
137
- const result = getSafeCalendarMonth({
138
- year: 2082,
139
- month: 1,
140
- });
141
- expect(result).toEqual({ year: 2081, month: 1 });
142
- });
143
-
144
- it('falls back to supported range when no valid input', () => {
145
- const result = getSafeCalendarMonth({});
146
- expect(result).toEqual({ year: 2081, month: 1 });
147
- });
148
-
149
- it('falls back to supported range when input is undefined', () => {
150
- const result = getSafeCalendarMonth();
151
- expect(result).toEqual({ year: 2081, month: 1 });
152
- });
153
- });