@rabindrapantha/nepali-bs-data 0.0.0-stage → 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 +144 -2
- package/dist/index.cjs +1295 -0
- package/dist/index.d.cts +36 -0
- package/dist/index.d.mts +36 -0
- package/dist/index.mjs +1283 -0
- package/package.json +64 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const BS_MONTH_DAYS: Readonly<Record<number, readonly number[]>>;
|
|
2
|
+
export declare const MONTH_NAMES: readonly ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"];
|
|
3
|
+
export declare const MONTH_NAMES_NE: readonly ["बैशाख", "जेठ", "असार", "श्रावण", "भदौ", "असोज", "कार्तिक", "मंसिर", "पौष", "माघ", "फागुन", "चैत"];
|
|
4
|
+
export declare const WEEKDAY_NAMES: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
5
|
+
export declare const WEEKDAY_NAMES_NE: readonly ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहीबार", "शुक्रबार", "शनिबार"];
|
|
6
|
+
export declare const BS_MIN_YEAR = 2000;
|
|
7
|
+
export declare const BS_MAX_YEAR = 2083;
|
|
8
|
+
/** BS 2000-01-01 is AD 1943-04-14. */
|
|
9
|
+
export declare const BS_ANCHOR: {
|
|
10
|
+
readonly bs: {
|
|
11
|
+
readonly year: 2000;
|
|
12
|
+
readonly month: 1;
|
|
13
|
+
readonly day: 1;
|
|
14
|
+
};
|
|
15
|
+
readonly ad: {
|
|
16
|
+
readonly year: 1943;
|
|
17
|
+
readonly month: 4;
|
|
18
|
+
readonly day: 14;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function isSupportedYear(year: number): boolean;
|
|
22
|
+
/** Days in a BS month. `month` is 1-12. Throws RangeError on bad input. */
|
|
23
|
+
export declare function daysInMonth(year: number, month: number): number;
|
|
24
|
+
export declare function daysInYear(year: number): number;
|
|
25
|
+
interface BsDate {
|
|
26
|
+
year: number;
|
|
27
|
+
/** 1-12, Baisakh first. */
|
|
28
|
+
month: number;
|
|
29
|
+
day: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Converts an AD date to BS. Reads the local calendar day of `date`; the time is ignored.
|
|
33
|
+
* Throws RangeError for an invalid Date or one outside the supported BS years.
|
|
34
|
+
*/
|
|
35
|
+
export declare function adToBs(date: Date): BsDate;
|
|
36
|
+
export type { BsDate };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const BS_MONTH_DAYS: Readonly<Record<number, readonly number[]>>;
|
|
2
|
+
export declare const MONTH_NAMES: readonly ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"];
|
|
3
|
+
export declare const MONTH_NAMES_NE: readonly ["बैशाख", "जेठ", "असार", "श्रावण", "भदौ", "असोज", "कार्तिक", "मंसिर", "पौष", "माघ", "फागुन", "चैत"];
|
|
4
|
+
export declare const WEEKDAY_NAMES: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
5
|
+
export declare const WEEKDAY_NAMES_NE: readonly ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहीबार", "शुक्रबार", "शनिबार"];
|
|
6
|
+
export declare const BS_MIN_YEAR = 2000;
|
|
7
|
+
export declare const BS_MAX_YEAR = 2083;
|
|
8
|
+
/** BS 2000-01-01 is AD 1943-04-14. */
|
|
9
|
+
export declare const BS_ANCHOR: {
|
|
10
|
+
readonly bs: {
|
|
11
|
+
readonly year: 2000;
|
|
12
|
+
readonly month: 1;
|
|
13
|
+
readonly day: 1;
|
|
14
|
+
};
|
|
15
|
+
readonly ad: {
|
|
16
|
+
readonly year: 1943;
|
|
17
|
+
readonly month: 4;
|
|
18
|
+
readonly day: 14;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function isSupportedYear(year: number): boolean;
|
|
22
|
+
/** Days in a BS month. `month` is 1-12. Throws RangeError on bad input. */
|
|
23
|
+
export declare function daysInMonth(year: number, month: number): number;
|
|
24
|
+
export declare function daysInYear(year: number): number;
|
|
25
|
+
interface BsDate {
|
|
26
|
+
year: number;
|
|
27
|
+
/** 1-12, Baisakh first. */
|
|
28
|
+
month: number;
|
|
29
|
+
day: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Converts an AD date to BS. Reads the local calendar day of `date`; the time is ignored.
|
|
33
|
+
* Throws RangeError for an invalid Date or one outside the supported BS years.
|
|
34
|
+
*/
|
|
35
|
+
export declare function adToBs(date: Date): BsDate;
|
|
36
|
+
export type { BsDate };
|