Skip to content

Commit 4b42986

Browse files
committed
fix: more typescript cleaning and fixing, add more docs
1 parent 87b022b commit 4b42986

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Diff for: README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ With the `@calidy/dayjs-calendarsystems` plugin, we bring the capacity to run an
2727
## Features
2828

2929
- Register and use different calendar systems.
30+
- Typescript exports and definitions.
31+
- Compatible with all official Dayjs plugins.
32+
- No need for hacks, use dayjs apis in the standard way.
33+
- Small and light plugin, no overhead.
3034
- Convert between different calendar systems.
3135
- Default Gregorian calendar system included.
3236
- Persian Calendar system available.
33-
- Other calendar systems are still under development.
37+
- **[WIP]** Islamic (Hijri, Umalqura) Calendar system. Note: we will use the default "islamic-umalqura" calendar system for "islamic" calendar system.
38+
- **[WIP]** Hebrew (Jewish) Calendar system.
39+
- **[WIP]** Ethiopian Calendar system.
3440
- **[TODO]** Parse date strings from different calendar systems
3541
- **[TODO]** Add more tests for all Dayjs Plugins
3642

@@ -60,6 +66,10 @@ import calendarSystems from "@calidy/dayjs-calendarsystems";
6066

6167
import PersianCalendarSystem from "@calidy/dayjs-calendarsystems/calendarSystems/PersianCalendarSystem";
6268

69+
// ...
70+
// ALL YOU OTHER dayjs.extend() calls
71+
// ...
72+
// After all other dayjs plugins are initialized, extend dayjs with our calendar systems plugin:
6373
dayjs.extend(calendarSystems);
6474

6575
// Register new calendar system

Diff for: types/index.d.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { PluginFunc, Dayjs } from 'dayjs';
22
import { CalendarSystemBase } from './calendarSystems/CalendarSystemBase';
3-
export type CalendarSystem = 'persian' | 'gregorian' | 'islamic' | 'julian' | 'indian' | 'hebrew' | 'ethiopian' | 'coptic' | 'buddhist' | 'japanese' | 'roc' | 'nanakshahi' | 'isoWeek' | 'week' | 'quarter' | 'month' | 'year' | 'decade' | 'century' | 'millennium';
3+
// All Calendar Systems known to Intl API (alphabetical order)
4+
// 'buddhist' | 'chinese' | 'coptic' | 'dangi' | 'ethioaa' | 'ethiopic' | 'gregory' | 'hebrew' | 'indian' | 'islamic' | 'islamic-civil' | 'islamic-rgsa' | 'islamic-tbla' | 'islamic-umalqura' | 'islamicc' | 'iso8601' | 'japanese' | 'persian' | 'roc'
5+
// Our supported Calendar Systems (alphabetical order)
6+
export type CalendarSystem = 'gregory' | 'persian';
7+
// TODO: export type CalendarSystem = 'gregory' | 'persian' | 'islamic' | 'islamic-umalqura' | 'hebrew' | 'ethiopic';
8+
// ! Note that we use the default "islamic-umalqura" calendar system for "islamic" calendar system
49

510
declare module 'dayjs' {
611
interface Dayjs {

0 commit comments

Comments
 (0)