react-native-bikram-sambat 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +340 -0
- package/lib/commonjs/accessibility/index.js +25 -0
- package/lib/commonjs/accessibility/index.js.map +1 -0
- package/lib/commonjs/accessibility/labels.js +20 -0
- package/lib/commonjs/accessibility/labels.js.map +1 -0
- package/lib/commonjs/calendar/calendar-types.js +6 -0
- package/lib/commonjs/calendar/calendar-types.js.map +1 -0
- package/lib/commonjs/calendar/get-calendar-month-grid.js +114 -0
- package/lib/commonjs/calendar/get-calendar-month-grid.js.map +1 -0
- package/lib/commonjs/calendar/index.js +13 -0
- package/lib/commonjs/calendar/index.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js +137 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js +116 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js +114 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarWeekdays.js +44 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarWeekdays.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js +288 -0
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/index.js +13 -0
- package/lib/commonjs/components/NepaliCalendar/index.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/types.js +6 -0
- package/lib/commonjs/components/NepaliCalendar/types.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js +185 -0
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js +148 -0
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/index.js +20 -0
- package/lib/commonjs/components/NepaliDatePicker/index.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/types.js +6 -0
- package/lib/commonjs/components/NepaliDatePicker/types.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js +187 -0
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js +275 -0
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/index.js +57 -0
- package/lib/commonjs/components/NepaliRangePicker/index.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js +70 -0
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/types.js +6 -0
- package/lib/commonjs/components/NepaliRangePicker/types.js.map +1 -0
- package/lib/commonjs/core/arithmetic.js +36 -0
- package/lib/commonjs/core/arithmetic.js.map +1 -0
- package/lib/commonjs/core/bsData.js +89 -0
- package/lib/commonjs/core/bsData.js.map +1 -0
- package/lib/commonjs/core/conversion.js +53 -0
- package/lib/commonjs/core/conversion.js.map +1 -0
- package/lib/commonjs/core/dateKey.js +31 -0
- package/lib/commonjs/core/dateKey.js.map +1 -0
- package/lib/commonjs/core/epochDay.js +47 -0
- package/lib/commonjs/core/epochDay.js.map +1 -0
- package/lib/commonjs/core/format/format.js +86 -0
- package/lib/commonjs/core/format/format.js.map +1 -0
- package/lib/commonjs/core/format/index.js +20 -0
- package/lib/commonjs/core/format/index.js.map +1 -0
- package/lib/commonjs/core/format/parse.js +41 -0
- package/lib/commonjs/core/format/parse.js.map +1 -0
- package/lib/commonjs/core/format/tokens.js +9 -0
- package/lib/commonjs/core/format/tokens.js.map +1 -0
- package/lib/commonjs/core/index.js +116 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/core/locale/en.js +15 -0
- package/lib/commonjs/core/locale/en.js.map +1 -0
- package/lib/commonjs/core/locale/index.js +20 -0
- package/lib/commonjs/core/locale/index.js.map +1 -0
- package/lib/commonjs/core/locale/ne.js +15 -0
- package/lib/commonjs/core/locale/ne.js.map +1 -0
- package/lib/commonjs/core/locale/types.js +2 -0
- package/lib/commonjs/core/locale/types.js.map +1 -0
- package/lib/commonjs/core/numerals/index.js +19 -0
- package/lib/commonjs/core/numerals/index.js.map +1 -0
- package/lib/commonjs/core/numerals/nepali-numerals.js +28 -0
- package/lib/commonjs/core/numerals/nepali-numerals.js.map +1 -0
- package/lib/commonjs/core/types.js +2 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/validation.js +125 -0
- package/lib/commonjs/core/validation.js.map +1 -0
- package/lib/commonjs/core/validation.test.js +248 -0
- package/lib/commonjs/core/validation.test.js.map +1 -0
- package/lib/commonjs/exports.test.js +133 -0
- package/lib/commonjs/exports.test.js.map +1 -0
- package/lib/commonjs/index.js +94 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/phase2.test.js +446 -0
- package/lib/commonjs/phase2.test.js.map +1 -0
- package/lib/commonjs/phase3.test.js +91 -0
- package/lib/commonjs/phase3.test.js.map +1 -0
- package/lib/commonjs/phase4.test.js +89 -0
- package/lib/commonjs/phase4.test.js.map +1 -0
- package/lib/commonjs/phase5.test.js +246 -0
- package/lib/commonjs/phase5.test.js.map +1 -0
- package/lib/commonjs/phase7.test.js +284 -0
- package/lib/commonjs/phase7.test.js.map +1 -0
- package/lib/commonjs/range-helpers.test.js +182 -0
- package/lib/commonjs/range-helpers.test.js.map +1 -0
- package/lib/commonjs/theme/create-theme.js +37 -0
- package/lib/commonjs/theme/create-theme.js.map +1 -0
- package/lib/commonjs/theme/default-theme.js +99 -0
- package/lib/commonjs/theme/default-theme.js.map +1 -0
- package/lib/commonjs/theme/index.js +26 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/utils/date-helpers.js +106 -0
- package/lib/commonjs/utils/date-helpers.js.map +1 -0
- package/lib/commonjs/utils/index.js +49 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/accessibility/index.js +4 -0
- package/lib/module/accessibility/index.js.map +1 -0
- package/lib/module/accessibility/labels.js +15 -0
- package/lib/module/accessibility/labels.js.map +1 -0
- package/lib/module/calendar/calendar-types.js +4 -0
- package/lib/module/calendar/calendar-types.js.map +1 -0
- package/lib/module/calendar/get-calendar-month-grid.js +111 -0
- package/lib/module/calendar/get-calendar-month-grid.js.map +1 -0
- package/lib/module/calendar/index.js +4 -0
- package/lib/module/calendar/index.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarDay.js +132 -0
- package/lib/module/components/NepaliCalendar/CalendarDay.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarGrid.js +111 -0
- package/lib/module/components/NepaliCalendar/CalendarGrid.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarHeader.js +109 -0
- package/lib/module/components/NepaliCalendar/CalendarHeader.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarWeekdays.js +39 -0
- package/lib/module/components/NepaliCalendar/CalendarWeekdays.js.map +1 -0
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js +283 -0
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js.map +1 -0
- package/lib/module/components/NepaliCalendar/index.js +4 -0
- package/lib/module/components/NepaliCalendar/index.js.map +1 -0
- package/lib/module/components/NepaliCalendar/types.js +4 -0
- package/lib/module/components/NepaliCalendar/types.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js +180 -0
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js +143 -0
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/index.js +5 -0
- package/lib/module/components/NepaliDatePicker/index.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/types.js +4 -0
- package/lib/module/components/NepaliDatePicker/types.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js +182 -0
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js +270 -0
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/index.js +6 -0
- package/lib/module/components/NepaliRangePicker/index.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/range-utils.js +61 -0
- package/lib/module/components/NepaliRangePicker/range-utils.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/types.js +4 -0
- package/lib/module/components/NepaliRangePicker/types.js.map +1 -0
- package/lib/module/core/arithmetic.js +29 -0
- package/lib/module/core/arithmetic.js.map +1 -0
- package/lib/module/core/bsData.js +82 -0
- package/lib/module/core/bsData.js.map +1 -0
- package/lib/module/core/conversion.js +48 -0
- package/lib/module/core/conversion.js.map +1 -0
- package/lib/module/core/dateKey.js +26 -0
- package/lib/module/core/dateKey.js.map +1 -0
- package/lib/module/core/epochDay.js +39 -0
- package/lib/module/core/epochDay.js.map +1 -0
- package/lib/module/core/format/format.js +82 -0
- package/lib/module/core/format/format.js.map +1 -0
- package/lib/module/core/format/index.js +5 -0
- package/lib/module/core/format/index.js.map +1 -0
- package/lib/module/core/format/parse.js +37 -0
- package/lib/module/core/format/parse.js.map +1 -0
- package/lib/module/core/format/tokens.js +5 -0
- package/lib/module/core/format/tokens.js.map +1 -0
- package/lib/module/core/index.js +13 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/locale/en.js +11 -0
- package/lib/module/core/locale/en.js.map +1 -0
- package/lib/module/core/locale/index.js +5 -0
- package/lib/module/core/locale/index.js.map +1 -0
- package/lib/module/core/locale/ne.js +11 -0
- package/lib/module/core/locale/ne.js.map +1 -0
- package/lib/module/core/locale/types.js +2 -0
- package/lib/module/core/locale/types.js.map +1 -0
- package/lib/module/core/numerals/index.js +4 -0
- package/lib/module/core/numerals/index.js.map +1 -0
- package/lib/module/core/numerals/nepali-numerals.js +23 -0
- package/lib/module/core/numerals/nepali-numerals.js.map +1 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/validation.js +115 -0
- package/lib/module/core/validation.js.map +1 -0
- package/lib/module/core/validation.test.js +248 -0
- package/lib/module/core/validation.test.js.map +1 -0
- package/lib/module/exports.test.js +133 -0
- package/lib/module/exports.test.js.map +1 -0
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/phase2.test.js +446 -0
- package/lib/module/phase2.test.js.map +1 -0
- package/lib/module/phase3.test.js +91 -0
- package/lib/module/phase3.test.js.map +1 -0
- package/lib/module/phase4.test.js +89 -0
- package/lib/module/phase4.test.js.map +1 -0
- package/lib/module/phase5.test.js +246 -0
- package/lib/module/phase5.test.js.map +1 -0
- package/lib/module/phase7.test.js +284 -0
- package/lib/module/phase7.test.js.map +1 -0
- package/lib/module/range-helpers.test.js +182 -0
- package/lib/module/range-helpers.test.js.map +1 -0
- package/lib/module/theme/create-theme.js +33 -0
- package/lib/module/theme/create-theme.js.map +1 -0
- package/lib/module/theme/default-theme.js +95 -0
- package/lib/module/theme/default-theme.js.map +1 -0
- package/lib/module/theme/index.js +5 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/utils/date-helpers.js +96 -0
- package/lib/module/utils/date-helpers.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/src/accessibility/index.d.ts +2 -0
- package/lib/typescript/src/accessibility/index.d.ts.map +1 -0
- package/lib/typescript/src/accessibility/labels.d.ts +6 -0
- package/lib/typescript/src/accessibility/labels.d.ts.map +1 -0
- package/lib/typescript/src/calendar/calendar-types.d.ts +23 -0
- package/lib/typescript/src/calendar/calendar-types.d.ts.map +1 -0
- package/lib/typescript/src/calendar/get-calendar-month-grid.d.ts +3 -0
- package/lib/typescript/src/calendar/get-calendar-month-grid.d.ts.map +1 -0
- package/lib/typescript/src/calendar/index.d.ts +3 -0
- package/lib/typescript/src/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts +23 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts +25 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts +17 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarWeekdays.d.ts +11 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarWeekdays.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts +4 -0
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/index.d.ts +3 -0
- package/lib/typescript/src/components/NepaliCalendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts +52 -0
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts +50 -0
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts +4 -0
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts +4 -0
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts +5 -0
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts +13 -0
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts +61 -0
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts.map +1 -0
- package/lib/typescript/src/core/arithmetic.d.ts +6 -0
- package/lib/typescript/src/core/arithmetic.d.ts.map +1 -0
- package/lib/typescript/src/core/bsData.d.ts +39 -0
- package/lib/typescript/src/core/bsData.d.ts.map +1 -0
- package/lib/typescript/src/core/conversion.d.ts +4 -0
- package/lib/typescript/src/core/conversion.d.ts.map +1 -0
- package/lib/typescript/src/core/dateKey.d.ts +4 -0
- package/lib/typescript/src/core/dateKey.d.ts.map +1 -0
- package/lib/typescript/src/core/epochDay.d.ts +7 -0
- package/lib/typescript/src/core/epochDay.d.ts.map +1 -0
- package/lib/typescript/src/core/format/format.d.ts +8 -0
- package/lib/typescript/src/core/format/format.d.ts.map +1 -0
- package/lib/typescript/src/core/format/index.d.ts +5 -0
- package/lib/typescript/src/core/format/index.d.ts.map +1 -0
- package/lib/typescript/src/core/format/parse.d.ts +7 -0
- package/lib/typescript/src/core/format/parse.d.ts.map +1 -0
- package/lib/typescript/src/core/format/tokens.d.ts +4 -0
- package/lib/typescript/src/core/format/tokens.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +11 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/en.d.ts +3 -0
- package/lib/typescript/src/core/locale/en.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/index.d.ts +4 -0
- package/lib/typescript/src/core/locale/index.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/ne.d.ts +3 -0
- package/lib/typescript/src/core/locale/ne.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/types.d.ts +11 -0
- package/lib/typescript/src/core/locale/types.d.ts.map +1 -0
- package/lib/typescript/src/core/numerals/index.d.ts +2 -0
- package/lib/typescript/src/core/numerals/index.d.ts.map +1 -0
- package/lib/typescript/src/core/numerals/nepali-numerals.d.ts +3 -0
- package/lib/typescript/src/core/numerals/nepali-numerals.d.ts.map +1 -0
- package/lib/typescript/src/core/types.d.ts +14 -0
- package/lib/typescript/src/core/types.d.ts.map +1 -0
- package/lib/typescript/src/core/validation.d.ts +17 -0
- package/lib/typescript/src/core/validation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/create-theme.d.ts +6 -0
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/default-theme.d.ts +4 -0
- package/lib/typescript/src/theme/default-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +4 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +43 -0
- package/lib/typescript/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/date-helpers.d.ts +27 -0
- package/lib/typescript/src/utils/date-helpers.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/accessibility/index.ts +5 -0
- package/src/accessibility/labels.ts +22 -0
- package/src/calendar/calendar-types.ts +25 -0
- package/src/calendar/get-calendar-month-grid.ts +125 -0
- package/src/calendar/index.ts +2 -0
- package/src/components/NepaliCalendar/CalendarDay.tsx +198 -0
- package/src/components/NepaliCalendar/CalendarGrid.tsx +159 -0
- package/src/components/NepaliCalendar/CalendarHeader.tsx +126 -0
- package/src/components/NepaliCalendar/CalendarWeekdays.tsx +49 -0
- package/src/components/NepaliCalendar/NepaliCalendar.tsx +279 -0
- package/src/components/NepaliCalendar/index.ts +6 -0
- package/src/components/NepaliCalendar/types.ts +62 -0
- package/src/components/NepaliDatePicker/DatePickerModal.tsx +220 -0
- package/src/components/NepaliDatePicker/NepaliDatePicker.tsx +171 -0
- package/src/components/NepaliDatePicker/index.ts +3 -0
- package/src/components/NepaliDatePicker/types.ts +70 -0
- package/src/components/NepaliRangePicker/NepaliRangePicker.tsx +206 -0
- package/src/components/NepaliRangePicker/RangePickerModal.tsx +336 -0
- package/src/components/NepaliRangePicker/index.ts +11 -0
- package/src/components/NepaliRangePicker/range-utils.ts +75 -0
- package/src/components/NepaliRangePicker/types.ts +84 -0
- package/src/core/arithmetic.ts +34 -0
- package/src/core/bsData.ts +115 -0
- package/src/core/conversion.ts +73 -0
- package/src/core/dateKey.ts +31 -0
- package/src/core/epochDay.ts +49 -0
- package/src/core/format/format.ts +108 -0
- package/src/core/format/index.ts +4 -0
- package/src/core/format/parse.ts +68 -0
- package/src/core/format/tokens.ts +35 -0
- package/src/core/index.ts +10 -0
- package/src/core/locale/en.ts +23 -0
- package/src/core/locale/index.ts +3 -0
- package/src/core/locale/ne.ts +31 -0
- package/src/core/locale/types.ts +12 -0
- package/src/core/numerals/index.ts +1 -0
- package/src/core/numerals/nepali-numerals.ts +27 -0
- package/src/core/types.ts +15 -0
- package/src/core/validation.test.ts +207 -0
- package/src/core/validation.ts +141 -0
- package/src/exports.test.ts +135 -0
- package/src/index.ts +8 -0
- package/src/phase2.test.ts +424 -0
- package/src/phase3.test.ts +83 -0
- package/src/phase4.test.ts +86 -0
- package/src/phase5.test.ts +257 -0
- package/src/phase7.test.ts +307 -0
- package/src/range-helpers.test.ts +153 -0
- package/src/theme/create-theme.ts +29 -0
- package/src/theme/default-theme.ts +99 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/types.ts +44 -0
- package/src/utils/date-helpers.ts +146 -0
- package/src/utils/index.ts +9 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ADDateValue, BSDateValue } from './types';
|
|
2
|
+
import { adDateToEpochDay, epochDayToADDate } from './epochDay';
|
|
3
|
+
import {
|
|
4
|
+
BS_CALENDAR_DATA,
|
|
5
|
+
BS_YEAR_OFFSETS,
|
|
6
|
+
getSupportedBSYearRange,
|
|
7
|
+
} from './bsData';
|
|
8
|
+
import { isValidADDate, isValidBSDate } from './validation';
|
|
9
|
+
|
|
10
|
+
export function toBS(date: ADDateValue): BSDateValue {
|
|
11
|
+
if (!isValidADDate(date)) {
|
|
12
|
+
throw new RangeError(`Invalid AD date.`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const epochDay = adDateToEpochDay(date);
|
|
16
|
+
const yearOffset = BS_YEAR_OFFSETS.find(
|
|
17
|
+
(offset) =>
|
|
18
|
+
epochDay >= offset.startEpochDay &&
|
|
19
|
+
epochDay < offset.startEpochDay + offset.totalDays
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
if (!yearOffset) {
|
|
23
|
+
throwUnsupportedRange();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const monthLengths = BS_CALENDAR_DATA.monthLengthsByYear[yearOffset.year];
|
|
27
|
+
let dayOfYear = epochDay - yearOffset.startEpochDay;
|
|
28
|
+
|
|
29
|
+
for (let monthIndex = 0; monthIndex < monthLengths.length; monthIndex += 1) {
|
|
30
|
+
const monthLength = monthLengths[monthIndex];
|
|
31
|
+
|
|
32
|
+
if (dayOfYear < monthLength) {
|
|
33
|
+
return {
|
|
34
|
+
calendar: 'BS',
|
|
35
|
+
year: yearOffset.year,
|
|
36
|
+
month: monthIndex + 1,
|
|
37
|
+
day: dayOfYear + 1,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
dayOfYear -= monthLength;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw new Error(`Failed to convert AD date to BS date.`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function toAD(date: BSDateValue): ADDateValue {
|
|
48
|
+
if (!isValidBSDate(date)) {
|
|
49
|
+
throw new RangeError(`Invalid BS date or unsupported BS year.`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const yearOffset = BS_YEAR_OFFSETS.find((offset) => offset.year === date.year);
|
|
53
|
+
|
|
54
|
+
if (!yearOffset) {
|
|
55
|
+
throwUnsupportedRange();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const monthLengths = BS_CALENDAR_DATA.monthLengthsByYear[date.year];
|
|
59
|
+
const daysBeforeMonth = monthLengths
|
|
60
|
+
.slice(0, date.month - 1)
|
|
61
|
+
.reduce((sum, days) => sum + days, 0);
|
|
62
|
+
const epochDay = yearOffset.startEpochDay + daysBeforeMonth + date.day - 1;
|
|
63
|
+
|
|
64
|
+
return epochDayToADDate(epochDay);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function throwUnsupportedRange(): never {
|
|
68
|
+
const range = getSupportedBSYearRange();
|
|
69
|
+
|
|
70
|
+
throw new RangeError(
|
|
71
|
+
`Conversion is limited to BS years ${range.min}-${range.max} until verified month data is added.`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BSDateKey, BSDateValue } from './types';
|
|
2
|
+
import { isValidBSDate } from './validation';
|
|
3
|
+
|
|
4
|
+
function pad2(value: number): string {
|
|
5
|
+
return String(value).padStart(2, '0');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function createBSDateKey(date: BSDateValue): BSDateKey {
|
|
9
|
+
if (!isValidBSDate(date)) {
|
|
10
|
+
throw new RangeError(`Cannot create a BS date key from an invalid date.`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return `${date.year}-${pad2(date.month)}-${pad2(date.day)}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function parseBSDateKey(key: string): BSDateValue | null {
|
|
17
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(key);
|
|
18
|
+
|
|
19
|
+
if (!match) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const date: BSDateValue = {
|
|
24
|
+
calendar: 'BS',
|
|
25
|
+
year: Number(match[1]),
|
|
26
|
+
month: Number(match[2]),
|
|
27
|
+
day: Number(match[3]),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return isValidBSDate(date) ? date : null;
|
|
31
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ADDateValue } from './types';
|
|
2
|
+
|
|
3
|
+
const MS_PER_DAY = 86_400_000;
|
|
4
|
+
|
|
5
|
+
export function adDateToEpochDay(date: ADDateValue): number {
|
|
6
|
+
return Math.floor(utcMillisForADDate(date) / MS_PER_DAY);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function epochDayToADDate(epochDay: number): ADDateValue {
|
|
10
|
+
if (!Number.isInteger(epochDay)) {
|
|
11
|
+
throw new RangeError(`Epoch day must be an integer.`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const value = new Date(epochDay * MS_PER_DAY);
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
calendar: 'AD',
|
|
18
|
+
year: value.getUTCFullYear(),
|
|
19
|
+
month: value.getUTCMonth() + 1,
|
|
20
|
+
day: value.getUTCDate(),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function jsDateToEpochDay(date: Date): number {
|
|
25
|
+
return Math.floor(
|
|
26
|
+
utcMillisForADDate({
|
|
27
|
+
calendar: 'AD',
|
|
28
|
+
year: date.getUTCFullYear(),
|
|
29
|
+
month: date.getUTCMonth() + 1,
|
|
30
|
+
day: date.getUTCDate(),
|
|
31
|
+
}) / MS_PER_DAY
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function epochDayToJSDate(epochDay: number): Date {
|
|
36
|
+
if (!Number.isInteger(epochDay)) {
|
|
37
|
+
throw new RangeError(`Epoch day must be an integer.`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return new Date(epochDay * MS_PER_DAY);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function utcMillisForADDate(date: ADDateValue): number {
|
|
44
|
+
const value = new Date(0);
|
|
45
|
+
value.setUTCFullYear(date.year, date.month - 1, date.day);
|
|
46
|
+
value.setUTCHours(0, 0, 0, 0);
|
|
47
|
+
|
|
48
|
+
return value.getTime();
|
|
49
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { BSDateValue } from '../types';
|
|
2
|
+
import type { CalendarLocale, LocaleCode, NumeralSystem } from '../locale';
|
|
3
|
+
import { EN_LOCALE, NE_LOCALE } from '../locale';
|
|
4
|
+
import { toNepaliNumerals } from '../numerals';
|
|
5
|
+
import { toAD } from '../conversion';
|
|
6
|
+
import { isValidBSDate } from '../validation';
|
|
7
|
+
import { getSupportedBSYearRange } from '../bsData';
|
|
8
|
+
import { FORMAT_TOKENS, NUMERIC_TOKENS, FormatToken } from './tokens';
|
|
9
|
+
|
|
10
|
+
export type FormatBSOptions = {
|
|
11
|
+
locale?: LocaleCode | CalendarLocale;
|
|
12
|
+
numerals?: NumeralSystem;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function resolveLocale(locale: LocaleCode | CalendarLocale | undefined): CalendarLocale {
|
|
16
|
+
if (!locale) return EN_LOCALE;
|
|
17
|
+
if (typeof locale === 'string') {
|
|
18
|
+
return locale === 'ne' ? NE_LOCALE : EN_LOCALE;
|
|
19
|
+
}
|
|
20
|
+
return locale;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function pad2(value: number): string {
|
|
24
|
+
return String(value).padStart(2, '0');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function formatToken(
|
|
28
|
+
date: BSDateValue,
|
|
29
|
+
token: FormatToken,
|
|
30
|
+
locale: CalendarLocale
|
|
31
|
+
): string {
|
|
32
|
+
switch (token) {
|
|
33
|
+
case 'yyyy':
|
|
34
|
+
return String(date.year);
|
|
35
|
+
case 'yy':
|
|
36
|
+
return String(date.year).slice(-2);
|
|
37
|
+
case 'MMMM':
|
|
38
|
+
return locale.months[date.month - 1];
|
|
39
|
+
case 'MMM':
|
|
40
|
+
return locale.monthsShort[date.month - 1];
|
|
41
|
+
case 'MM':
|
|
42
|
+
return pad2(date.month);
|
|
43
|
+
case 'M':
|
|
44
|
+
return String(date.month);
|
|
45
|
+
case 'EEEE':
|
|
46
|
+
return locale.weekdays[getUTCDay(date)];
|
|
47
|
+
case 'EEE':
|
|
48
|
+
case 'E':
|
|
49
|
+
return locale.weekdaysShort[getUTCDay(date)];
|
|
50
|
+
case 'dd':
|
|
51
|
+
return pad2(date.day);
|
|
52
|
+
case 'd':
|
|
53
|
+
return String(date.day);
|
|
54
|
+
default:
|
|
55
|
+
return token;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function getUTCDay(date: BSDateValue): number {
|
|
60
|
+
const ad = toAD(date);
|
|
61
|
+
const utcDate = new Date(Date.UTC(ad.year, ad.month - 1, ad.day));
|
|
62
|
+
return utcDate.getUTCDay();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function formatBS(
|
|
66
|
+
date: BSDateValue,
|
|
67
|
+
pattern: string,
|
|
68
|
+
options?: FormatBSOptions
|
|
69
|
+
): string {
|
|
70
|
+
if (!isValidBSDate(date)) {
|
|
71
|
+
const range = getSupportedBSYearRange();
|
|
72
|
+
const dateStr = `${date.year}-${String(date.month).padStart(2, '0')}-${String(date.day).padStart(2, '0')}`;
|
|
73
|
+
throw new RangeError(
|
|
74
|
+
`Cannot format invalid BS date ${dateStr}. Supported BS range is ${range.min}–${range.max}.`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const locale = resolveLocale(options?.locale);
|
|
79
|
+
const numerals = options?.numerals;
|
|
80
|
+
let result = '';
|
|
81
|
+
let i = 0;
|
|
82
|
+
|
|
83
|
+
while (i < pattern.length) {
|
|
84
|
+
let matched = false;
|
|
85
|
+
|
|
86
|
+
for (const token of FORMAT_TOKENS) {
|
|
87
|
+
if (pattern.slice(i, i + token.length) === token) {
|
|
88
|
+
let value = formatToken(date, token, locale);
|
|
89
|
+
|
|
90
|
+
if (numerals === 'devanagari' && NUMERIC_TOKENS.has(token)) {
|
|
91
|
+
value = toNepaliNumerals(value);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
result += value;
|
|
95
|
+
i += token.length;
|
|
96
|
+
matched = true;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!matched) {
|
|
102
|
+
result += pattern[i];
|
|
103
|
+
i += 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { BSDateValue } from '../types';
|
|
2
|
+
import type { NumeralSystem } from '../locale';
|
|
3
|
+
import { toLatinNumerals } from '../numerals';
|
|
4
|
+
import { isValidBSDate } from '../validation';
|
|
5
|
+
|
|
6
|
+
export type ParseBSOptions = {
|
|
7
|
+
numerals?: NumeralSystem;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const SUPPORTED_PATTERNS = ['yyyy-MM-dd'] as const;
|
|
11
|
+
|
|
12
|
+
type SupportedPattern = (typeof SUPPORTED_PATTERNS)[number];
|
|
13
|
+
|
|
14
|
+
function isSupportedPattern(pattern: string): pattern is SupportedPattern {
|
|
15
|
+
return SUPPORTED_PATTERNS.includes(pattern as SupportedPattern);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parseWithPattern(
|
|
19
|
+
value: string,
|
|
20
|
+
pattern: SupportedPattern,
|
|
21
|
+
numerals: NumeralSystem | undefined
|
|
22
|
+
): BSDateValue | null {
|
|
23
|
+
const normalized = numerals === 'devanagari' ? toLatinNumerals(value) : value;
|
|
24
|
+
|
|
25
|
+
if (pattern === 'yyyy-MM-dd') {
|
|
26
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(normalized);
|
|
27
|
+
|
|
28
|
+
if (!match) return null;
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
calendar: 'BS',
|
|
32
|
+
year: Number(match[1]),
|
|
33
|
+
month: Number(match[2]),
|
|
34
|
+
day: Number(match[3]),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function parseBS(
|
|
42
|
+
value: string,
|
|
43
|
+
pattern: string,
|
|
44
|
+
options?: ParseBSOptions
|
|
45
|
+
): BSDateValue {
|
|
46
|
+
if (!isSupportedPattern(pattern)) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`Unsupported parse pattern "${pattern}". Phase 2 only supports "yyyy-MM-dd".`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const numerals = options?.numerals;
|
|
53
|
+
const result = parseWithPattern(value, pattern, numerals);
|
|
54
|
+
|
|
55
|
+
if (!result) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
`Failed to parse "${value}" with pattern "${pattern}". Expected 4-digit year, 2-digit month, and 2-digit day separated by hyphens.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!isValidBSDate(result)) {
|
|
62
|
+
throw new RangeError(
|
|
63
|
+
`Parsed date ${result.year}-${String(result.month).padStart(2, '0')}-${String(result.day).padStart(2, '0')} is not a valid BS date or falls outside the supported data range.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type FormatToken =
|
|
2
|
+
| 'yyyy'
|
|
3
|
+
| 'yy'
|
|
4
|
+
| 'MMMM'
|
|
5
|
+
| 'MMM'
|
|
6
|
+
| 'MM'
|
|
7
|
+
| 'M'
|
|
8
|
+
| 'EEEE'
|
|
9
|
+
| 'EEE'
|
|
10
|
+
| 'E'
|
|
11
|
+
| 'dd'
|
|
12
|
+
| 'd';
|
|
13
|
+
|
|
14
|
+
export const FORMAT_TOKENS: readonly FormatToken[] = [
|
|
15
|
+
'yyyy',
|
|
16
|
+
'yy',
|
|
17
|
+
'MMMM',
|
|
18
|
+
'MMM',
|
|
19
|
+
'MM',
|
|
20
|
+
'M',
|
|
21
|
+
'EEEE',
|
|
22
|
+
'EEE',
|
|
23
|
+
'E',
|
|
24
|
+
'dd',
|
|
25
|
+
'd',
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export const NUMERIC_TOKENS: ReadonlySet<FormatToken> = new Set([
|
|
29
|
+
'yyyy',
|
|
30
|
+
'yy',
|
|
31
|
+
'MM',
|
|
32
|
+
'M',
|
|
33
|
+
'dd',
|
|
34
|
+
'd',
|
|
35
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './epochDay';
|
|
3
|
+
export * from './bsData';
|
|
4
|
+
export * from './conversion';
|
|
5
|
+
export * from './dateKey';
|
|
6
|
+
export * from './validation';
|
|
7
|
+
export * from './arithmetic';
|
|
8
|
+
export * from './numerals';
|
|
9
|
+
export * from './locale';
|
|
10
|
+
export * from './format';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CalendarLocale } from './types';
|
|
2
|
+
|
|
3
|
+
export const EN_LOCALE: CalendarLocale = {
|
|
4
|
+
code: 'en',
|
|
5
|
+
months: [
|
|
6
|
+
'Baisakh',
|
|
7
|
+
'Jestha',
|
|
8
|
+
'Ashadh',
|
|
9
|
+
'Shrawan',
|
|
10
|
+
'Bhadra',
|
|
11
|
+
'Ashwin',
|
|
12
|
+
'Kartik',
|
|
13
|
+
'Mangsir',
|
|
14
|
+
'Poush',
|
|
15
|
+
'Magh',
|
|
16
|
+
'Falgun',
|
|
17
|
+
'Chaitra',
|
|
18
|
+
],
|
|
19
|
+
monthsShort: ['Bai', 'Jes', 'Ash', 'Shr', 'Bha', 'Asw', 'Kar', 'Man', 'Pou', 'Mag', 'Fal', 'Cha'],
|
|
20
|
+
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
21
|
+
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
22
|
+
today: 'Today',
|
|
23
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CalendarLocale } from './types';
|
|
2
|
+
|
|
3
|
+
export const NE_LOCALE: CalendarLocale = {
|
|
4
|
+
code: 'ne',
|
|
5
|
+
months: [
|
|
6
|
+
'बैशाख',
|
|
7
|
+
'जेठ',
|
|
8
|
+
'असार',
|
|
9
|
+
'श्रावण',
|
|
10
|
+
'भाद्र',
|
|
11
|
+
'आश्विन',
|
|
12
|
+
'कार्तिक',
|
|
13
|
+
'मंसिर',
|
|
14
|
+
'पौष',
|
|
15
|
+
'माघ',
|
|
16
|
+
'फाल्गुन',
|
|
17
|
+
'चैत्र',
|
|
18
|
+
],
|
|
19
|
+
monthsShort: ['बै', 'जे', 'अ', 'श्रा', 'भा', 'आ', 'का', 'मं', 'पौ', 'मा', 'फा', 'चै'],
|
|
20
|
+
weekdays: [
|
|
21
|
+
'आइतबार',
|
|
22
|
+
'सोमबार',
|
|
23
|
+
'मंगलबार',
|
|
24
|
+
'बुधबार',
|
|
25
|
+
'बिहीबार',
|
|
26
|
+
'शुक्रबार',
|
|
27
|
+
'शनिबार',
|
|
28
|
+
],
|
|
29
|
+
weekdaysShort: ['आइत', 'सोम', 'मंगल', 'बुध', 'बिही', 'शुक्र', 'शनि'],
|
|
30
|
+
today: 'आज',
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type LocaleCode = 'en' | 'ne';
|
|
2
|
+
|
|
3
|
+
export type NumeralSystem = 'latin' | 'devanagari';
|
|
4
|
+
|
|
5
|
+
export type CalendarLocale = {
|
|
6
|
+
code: LocaleCode;
|
|
7
|
+
months: string[];
|
|
8
|
+
monthsShort: string[];
|
|
9
|
+
weekdays: string[];
|
|
10
|
+
weekdaysShort: string[];
|
|
11
|
+
today: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { toNepaliNumerals, toLatinNumerals } from './nepali-numerals';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const DEVANAGARI_DIGITS = ['०', '१', '२', '३', '४', '५', '६', '७', '८', '९'];
|
|
2
|
+
const LATIN_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
3
|
+
|
|
4
|
+
export function toNepaliNumerals(value: string | number): string {
|
|
5
|
+
const str = typeof value === 'number' ? String(value) : value;
|
|
6
|
+
|
|
7
|
+
return str.replace(/[0-9]/g, (digit) => DEVANAGARI_DIGITS[Number(digit)]);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function toLatinNumerals(value: string | number): string {
|
|
11
|
+
const str = typeof value === 'number' ? String(value) : value;
|
|
12
|
+
|
|
13
|
+
let result = '';
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < str.length; i++) {
|
|
16
|
+
const char = str[i];
|
|
17
|
+
const index = DEVANAGARI_DIGITS.indexOf(char);
|
|
18
|
+
|
|
19
|
+
if (index !== -1) {
|
|
20
|
+
result += LATIN_DIGITS[index];
|
|
21
|
+
} else {
|
|
22
|
+
result += char;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type BSDateValue = {
|
|
2
|
+
calendar: 'BS';
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
day: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ADDateValue = {
|
|
9
|
+
calendar: 'AD';
|
|
10
|
+
year: number;
|
|
11
|
+
month: number;
|
|
12
|
+
day: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type BSDateKey = `${number}-${string}-${string}`;
|