@wesantal/santali-calendar 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WeSantal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # @wesantal/santali-calendar
2
+
3
+ A framework-independent Santali Calendar data and utility package for JavaScript and TypeScript applications.
4
+
5
+ Maps the traditional Santali lunisolar calendar onto the Gregorian calendar using the 19-year Metonic cycle for leap year calculation.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @wesantal/santali-calendar
11
+ # or
12
+ bun add @wesantal/santali-calendar
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import {
19
+ getCalendar,
20
+ getToday,
21
+ getDate,
22
+ getMonth,
23
+ isLeapYear,
24
+ weekDays,
25
+ festivals,
26
+ months,
27
+ formatDate,
28
+ formatDateShort,
29
+ toOlChikiNumeral,
30
+ } from "@wesantal/santali-calendar";
31
+
32
+ // Get today's Santali date
33
+ const today = getToday();
34
+ // { day: 15, year: 2026, month: "ᱢᱟᱜᱽ", monthIndex: 0, startDate: "...", endDate: "..." }
35
+
36
+ // Convert any Gregorian date
37
+ const date = getDate(new Date("2026-06-15"));
38
+
39
+ // Get full calendar grid for a year
40
+ const calendar = getCalendar(2026);
41
+
42
+ // Check leap year
43
+ isLeapYear(2026); // true (Metonic position 1)
44
+ isLeapYear(2027); // false
45
+
46
+ // Get a single month
47
+ const magh = getMonth(2026, 0);
48
+
49
+ // Convert numbers to Ol Chiki script
50
+ toOlChikiNumeral(2026); // "᱒᱐᱒᱖"
51
+
52
+ // Format dates
53
+ formatDate("2026-01-19T00:00:00.000Z"); // "19 January 2026"
54
+ formatDateShort("2026-01-19T00:00:00.000Z"); // "19 Jan 2026"
55
+ ```
56
+
57
+ ## Calendar Structure
58
+
59
+ `getCalendar(year)` returns a `BuiltSantaliCalendarYear`:
60
+
61
+ ```typescript
62
+ {
63
+ year: 2026,
64
+ startDate: "2026-01-19T00:00:00.000Z",
65
+ endDate: "2027-01-07T00:00:00.000Z",
66
+ months: [
67
+ {
68
+ name: "ᱢᱟᱜᱽ",
69
+ days: 30,
70
+ startDate: "2026-01-19T00:00:00.000Z",
71
+ endDate: "2026-02-17T00:00:00.000Z",
72
+ calendar: {
73
+ sun: [null, { day: 7, date: "...", isCurrentMonth: true }, ...],
74
+ mon: [{ day: 1, date: "...", isCurrentMonth: true }, ...],
75
+ // ... all 7 weekdays
76
+ }
77
+ },
78
+ // ... 12 or 13 months
79
+ ]
80
+ }
81
+ ```
82
+
83
+ ### Calendar Grid
84
+
85
+ Each weekday column (`sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`) contains cells that are either:
86
+
87
+ - A `SantaliCalendarDay` object:
88
+ ```typescript
89
+ { day: 1, date: "2026-01-19T00:00:00.000Z", isCurrentMonth: true }
90
+ ```
91
+ - `null` for empty padding cells
92
+
93
+ ## Santali Months
94
+
95
+ | # | Name | Ol Chiki | Days |
96
+ |---|------|----------|------|
97
+ | 0 | Mag | ᱢᱟᱜᱽ | 30 |
98
+ | 1 | Phagun | ᱯᱷᱟ.ᱜᱩᱱ | 29 |
99
+ | 2 | Chaat | ᱪᱟ.ᱛ | 30 |
100
+ | 3 | Baisak | ᱵᱟ.ᱭᱥᱟ.ᱠ | 29 |
101
+ | 4 | Jhent | ᱡᱷᱮᱸᱴ | 30 |
102
+ | 5 | Asal | ᱟᱥᱟᱲ | 29 |
103
+ | 6 | Saan | ᱥᱟᱱ | 30 |
104
+ | 7 | Bhador | ᱵᱷᱟᱫᱚᱨ | 29 |
105
+ | 8 | Dasain | ᱫᱟᱥᱟᱸᱭ | 30 |
106
+ | 9 | Saharay | ᱥᱚᱦᱨᱟᱭ | 29 |
107
+ | 10 | Aghan | ᱟᱜᱷᱟᱬ | 30 |
108
+ | 11 | Pus | ᱯᱩᱥ | 29 |
109
+
110
+ **Normal year:** 354 days (12 months). **Leap year:** 384 days (adds Sarcha, a 30-day intercalary month).
111
+
112
+ ## Gregorian Date Mapping
113
+
114
+ A Santali month spans parts of two Gregorian months. Example:
115
+
116
+ - **ᱢᱟᱜᱽ (Mag) 2026:** January 19 – February 17
117
+
118
+ ```
119
+ ᱢᱟᱜᱽ (Mag)
120
+ sun null 7* 14* 21* 28*
121
+ mon 1* 8* 15* 22* 29*
122
+ tue 2* 9* 16* 23* 30*
123
+ wed 3* 10* 17* 24* 1
124
+ thu 4* 11* 18* 25* 2
125
+ fri 5* 12* 19* 26* 3
126
+ sat 6* 13* 20* 27* 4
127
+
128
+ * = current month day
129
+ numbers without * = next month overflow
130
+ null = empty cell
131
+ ```
132
+
133
+ ## API Reference
134
+
135
+ | Function | Description |
136
+ |----------|-------------|
137
+ | `getCalendar(year)` | Full calendar grid for a Santali year |
138
+ | `getMonth(year, monthIndex)` | Single month with calendar grid |
139
+ | `getToday()` | Today's Santali date |
140
+ | `getDate(date)` | Convert a Gregorian date to Santali |
141
+ | `isLeapYear(year)` | Check if year has 13 months |
142
+ | `buildYearStart(year)` | Gregorian start date for a Santali year |
143
+ | `formatDate(iso)` | Long format date (e.g. "19 January 2026") |
144
+ | `formatDateShort(iso)` | Short format date (e.g. "19 Jan 2026") |
145
+ | `toOlChikiNumeral(n)` | Convert number to Ol Chiki script |
146
+
147
+ ### Constants
148
+
149
+ | Export | Description |
150
+ |--------|-------------|
151
+ | `months` | Array of 12 base month definitions |
152
+ | `festivals` | Array of 11 festivals with metadata |
153
+ | `weekDays` | Weekday names in Ol Chiki script |
154
+ | `METONIC_CYCLE_START` | Metonic cycle anchor year (2026) |
155
+ | `METONIC_LEAP_POS` | Set of leap positions within the cycle |
156
+
157
+ ## Festivals
158
+
159
+ ```typescript
160
+ import { festivals } from "@wesantal/santali-calendar";
161
+
162
+ festivals.forEach((f) => {
163
+ console.log(`${f.name}: ${f.date ?? "Date varies"}`);
164
+ });
165
+ ```
166
+
167
+ Each festival includes `id`, `name`, `date`, `santaliMonth`, `description`, and `type` (`"festival"`, `"cultural"`, or `"community"`).
168
+
169
+ ## TypeScript
170
+
171
+ Full type support:
172
+
173
+ ```typescript
174
+ import type {
175
+ WeekDay,
176
+ SantaliMonth,
177
+ SantaliCalendarYear,
178
+ SantaliCalendar,
179
+ SantaliCalendarDay,
180
+ SantaliCalendarDayCell,
181
+ SantaliCalendarMonth,
182
+ BuiltSantaliCalendarYear,
183
+ SantaliMonthInfo,
184
+ SantaliFestival,
185
+ TodaySantaliDate,
186
+ } from "@wesantal/santali-calendar";
187
+ ```
188
+
189
+ ## License
190
+
191
+ MIT
@@ -0,0 +1,3 @@
1
+ import { SantaliCalendarMonth, SantaliMonth } from "./types.js";
2
+ export declare function buildNormalMonth(month: SantaliMonth, previousMonth?: SantaliMonth, nextMonth?: SantaliMonth): SantaliCalendarMonth;
3
+ //# sourceMappingURL=calendar.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.utils.d.ts","sourceRoot":"","sources":["../src/calendar.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,oBAAoB,EACpB,YAAY,EAEb,MAAM,YAAY,CAAC;AAiDpB,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,aAAa,CAAC,EAAE,YAAY,EAC5B,SAAS,CAAC,EAAE,YAAY,GACvB,oBAAoB,CAyDtB"}
@@ -0,0 +1,90 @@
1
+ import { addDays, formatDate, getDay, isToday, toDate } from "date-fns";
2
+ import { toOlChikiNumeral } from "./number.utils.js";
3
+ const WEEKDAY_INDEX = [
4
+ "sun",
5
+ "mon",
6
+ "tue",
7
+ "wed",
8
+ "thu",
9
+ "fri",
10
+ "sat",
11
+ ];
12
+ function createCalendarDay(day, date, isCurrentMonth) {
13
+ return {
14
+ day: toOlChikiNumeral(day),
15
+ date: formatDate(date, "yyyy-MM-dd"),
16
+ isCurrentMonth,
17
+ isToday: isToday(date),
18
+ };
19
+ }
20
+ const EMPTY_CALENDAR = () => ({
21
+ sun: [],
22
+ mon: [],
23
+ tue: [],
24
+ wed: [],
25
+ thu: [],
26
+ fri: [],
27
+ sat: [],
28
+ });
29
+ function cellsToCalendar(cells) {
30
+ const calendar = EMPTY_CALENDAR();
31
+ const rows = Math.ceil(cells.length / 7);
32
+ for (let row = 0; row < rows; row++) {
33
+ for (let col = 0; col < 7; col++) {
34
+ const index = row * 7 + col;
35
+ calendar[WEEKDAY_INDEX[col]][row] = cells[index] ?? null;
36
+ }
37
+ }
38
+ return calendar;
39
+ }
40
+ export function buildNormalMonth(month, previousMonth, nextMonth) {
41
+ const cells = [];
42
+ const startDow = getDay(toDate(month.startDate));
43
+ /*
44
+ * Previous month days.
45
+ * Gregorian calendar jaisa leading dates.
46
+ */
47
+ if (previousMonth) {
48
+ const previousStart = toDate(previousMonth.startDate);
49
+ const firstPreviousDay = previousMonth.days - startDow + 1;
50
+ for (let day = firstPreviousDay; day <= previousMonth.days; day++) {
51
+ cells.push({
52
+ isToday: false,
53
+ isCurrentMonth: false,
54
+ day: toOlChikiNumeral(day),
55
+ date: formatDate(addDays(previousStart, day - 1), "yyyy-MM-dd"),
56
+ });
57
+ }
58
+ }
59
+ else {
60
+ for (let i = 0; i < startDow; i++) {
61
+ cells.push(null);
62
+ }
63
+ }
64
+ /*
65
+ * Current month.
66
+ */
67
+ for (let day = 1; day <= month.days; day++) {
68
+ cells.push(createCalendarDay(day, addDays(toDate(month.startDate), day - 1), true));
69
+ }
70
+ /*
71
+ * Gregorian calendars normally complete
72
+ * the final week with next-month dates.
73
+ */
74
+ const remainder = cells.length % 7;
75
+ if (remainder !== 0 && nextMonth) {
76
+ const required = 7 - remainder;
77
+ const nextStart = toDate(nextMonth.startDate);
78
+ for (let day = 1; day <= required && day <= nextMonth.days; day++) {
79
+ cells.push(createCalendarDay(day, addDays(nextStart, day - 1), false));
80
+ }
81
+ }
82
+ while (cells.length % 7 !== 0) {
83
+ cells.push(null);
84
+ }
85
+ return {
86
+ ...month,
87
+ weeks: cellsToCalendar(cells),
88
+ };
89
+ }
90
+ //# sourceMappingURL=calendar.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.utils.js","sourceRoot":"","sources":["../src/calendar.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQrD,MAAM,aAAa,GAAc;IAC/B,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AAEF,SAAS,iBAAiB,CACxB,GAAW,EACX,IAAU,EACV,cAAuB;IAEvB,OAAO;QACL,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC;QAC1B,IAAI,EAAE,UAAU,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IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;YAClE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,KAAK;QACR,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SantaliFestival } from "./types.js";
2
+ export declare const festivals: SantaliFestival[];
3
+ //# sourceMappingURL=festivals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"festivals.d.ts","sourceRoot":"","sources":["../src/festivals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,eAAO,MAAM,SAAS,EAAE,eAAe,EA2FtC,CAAC"}
@@ -0,0 +1,86 @@
1
+ export const festivals = [
2
+ {
3
+ id: "baha-2026",
4
+ name: "Baha Puja (Flower Festival)",
5
+ date: "2026-03-05",
6
+ santaliMonth: "Phagun",
7
+ description: "Santali flower festival welcoming spring, one of the most beloved celebrations of the Santali people.",
8
+ type: "cultural",
9
+ },
10
+ {
11
+ id: "karma-puja-2026",
12
+ name: "Karma Puja",
13
+ date: "2026-08-28",
14
+ santaliMonth: "Bhadon",
15
+ description: "Santali festival worshipping the Karma tree, celebrated by youth for prosperity and good fortune.",
16
+ type: "cultural",
17
+ },
18
+ {
19
+ id: "sohrae-2026",
20
+ name: "Sohrae",
21
+ date: "2026-10-25",
22
+ santaliMonth: "Kunwar",
23
+ description: "Santali harvest festival — the most important festival of the Santali people, celebrating the new harvest.",
24
+ type: "festival",
25
+ },
26
+ {
27
+ id: "mage-parab-2026",
28
+ name: "Mage Parab",
29
+ date: "2026-01-25",
30
+ santaliMonth: "Mag",
31
+ description: "An important Santali festival celebrated in the month of Mag with community prayers and feasting.",
32
+ type: "cultural",
33
+ },
34
+ {
35
+ id: "ero-2026",
36
+ name: "Ero",
37
+ date: "2026-04-15",
38
+ santaliMonth: "Jeth",
39
+ description: "A Santali sowing festival marking the beginning of the agricultural season.",
40
+ type: "community",
41
+ },
42
+ {
43
+ id: "bandna-2026",
44
+ name: "Bandna",
45
+ date: "2026-09-15",
46
+ santaliMonth: "Kati",
47
+ description: "A cattle-worshipping festival celebrated by Adivasi communities including the Santali.",
48
+ type: "community",
49
+ },
50
+ {
51
+ id: "republic-day-2026",
52
+ name: "Republic Day (India)",
53
+ date: "2026-01-26",
54
+ description: "India adopted its constitution on this day in 1950.",
55
+ type: "festival",
56
+ },
57
+ {
58
+ id: "holi-2026",
59
+ name: "Holi",
60
+ date: "2026-03-04",
61
+ description: "Festival of colours celebrated across India.",
62
+ type: "festival",
63
+ },
64
+ {
65
+ id: "independence-day-2026",
66
+ name: "Independence Day (India)",
67
+ date: "2026-08-15",
68
+ description: "India gained independence from British rule on 15 August 1947.",
69
+ type: "festival",
70
+ },
71
+ {
72
+ id: "gandhi-jayanti-2026",
73
+ name: "Gandhi Jayanti",
74
+ date: "2026-10-02",
75
+ description: "Birth anniversary of Mahatma Gandhi, Father of the Nation.",
76
+ type: "festival",
77
+ },
78
+ {
79
+ id: "christmas-2026",
80
+ name: "Christmas Day",
81
+ date: "2026-12-25",
82
+ description: "Christian festival celebrating the birth of Jesus Christ.",
83
+ type: "festival",
84
+ },
85
+ ];
86
+ //# sourceMappingURL=festivals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"festivals.js","sourceRoot":"","sources":["../src/festivals.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAsB;IAC1C;QACE,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,6BAA6B;QACnC,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AY;QAClB,WAAW,EACT,gEAAgE;QAClE,IAAI,EAAE,UAAU;KACjB;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,4DAA4D;QACzE,IAAI,EAAE,UAAU;KACjB;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,2DAA2D;QACxE,IAAI,EAAE,UAAU;KACjB;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./festivals.js";
2
+ export * from "./months.js";
3
+ export * from "./number.utils.js";
4
+ export * from "./types.js";
5
+ export * from "./utils.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./festivals.js";
2
+ export * from "./months.js";
3
+ export * from "./number.utils.js";
4
+ export * from "./types.js";
5
+ export * from "./utils.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const METONIC_CYCLE_START = 2026;
2
+ export declare const METONIC_LEAP_POS: Set<number>;
3
+ export declare const YEAR_ANCHOR_DATE = "2026-01-19T00:00:00.000Z";
4
+ export declare function isLeapYear(y: number): boolean;
5
+ //# sourceMappingURL=leap-year.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leap-year.utils.d.ts","sourceRoot":"","sources":["../src/leap-year.utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,gBAAgB,aAAoC,CAAC;AAClE,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAI7C"}
@@ -0,0 +1,9 @@
1
+ export const METONIC_CYCLE_START = 2026;
2
+ export const METONIC_LEAP_POS = new Set([1, 4, 7, 9, 12, 15, 18]);
3
+ export const YEAR_ANCHOR_DATE = "2026-01-19T00:00:00.000Z";
4
+ export function isLeapYear(y) {
5
+ // Normalize year to a 1-19 position
6
+ const pos = ((((y - METONIC_CYCLE_START) % 19) + 19) % 19) + 1;
7
+ return METONIC_LEAP_POS.has(pos);
8
+ }
9
+ //# sourceMappingURL=leap-year.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leap-year.utils.js","sourceRoot":"","sources":["../src/leap-year.utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAE3D,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,oCAAoC;IACpC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/D,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SantaliMonthInfo } from "./types.js";
2
+ export declare const months: SantaliMonthInfo[];
3
+ //# sourceMappingURL=months.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"months.d.ts","sourceRoot":"","sources":["../src/months.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,MAAM,EAAE,gBAAgB,EA6DpC,CAAC"}
package/dist/months.js ADDED
@@ -0,0 +1,63 @@
1
+ export const months = [
2
+ {
3
+ days: 30,
4
+ name: "ᱢᱟᱜᱽ",
5
+ english: "Mag",
6
+ },
7
+ {
8
+ days: 29,
9
+ name: "ᱯᱷᱟ.ᱜᱩᱱ",
10
+ english: "Phagun",
11
+ },
12
+ {
13
+ days: 30,
14
+ name: "ᱪᱟ.ᱛ",
15
+ english: "Chaat",
16
+ },
17
+ {
18
+ days: 29,
19
+ name: "ᱵᱟ.ᱭᱥᱟ.ᱠ",
20
+ english: "Baisak",
21
+ },
22
+ {
23
+ days: 30,
24
+ name: "ᱡᱷᱮᱸᱴ",
25
+ english: "Jhent",
26
+ },
27
+ {
28
+ days: 29,
29
+ name: "ᱟᱥᱟᱲ",
30
+ english: "Asal",
31
+ },
32
+ {
33
+ days: 30,
34
+ name: "ᱥᱟᱱ",
35
+ english: "Saan",
36
+ },
37
+ {
38
+ days: 29,
39
+ name: "ᱵᱷᱟᱫᱚᱨ",
40
+ english: "Bhador",
41
+ },
42
+ {
43
+ days: 30,
44
+ name: "ᱫᱟᱥᱟᱸᱭ",
45
+ english: "Dasain",
46
+ },
47
+ {
48
+ days: 29,
49
+ name: "ᱥᱚᱦᱨᱟᱭ",
50
+ english: "Saharay",
51
+ },
52
+ {
53
+ days: 30,
54
+ name: "ᱟᱜᱷᱟᱬ",
55
+ english: "Aghan",
56
+ },
57
+ {
58
+ days: 29,
59
+ name: "ᱯᱩᱥ",
60
+ english: "Pus",
61
+ },
62
+ ];
63
+ //# sourceMappingURL=months.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"months.js","sourceRoot":"","sources":["../src/months.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,KAAK;KACf;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,QAAQ;KAClB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;KACjB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,QAAQ;KAClB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;KACjB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;KAChB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,MAAM;KAChB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,QAAQ;KAClB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,QAAQ;KAClB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;KACjB;IACD;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,KAAK;KACf;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Convert an Arabic numeral (e.g. 19) to Ol Chiki numeral string (e.g. ᱑᱙). */
2
+ export declare function toOlChikiNumeral(n: number): string;
3
+ //# sourceMappingURL=number.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.utils.d.ts","sourceRoot":"","sources":["../src/number.utils.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKlD"}
@@ -0,0 +1,9 @@
1
+ const OL_CHIKI_DIGITS = ["᱐", "᱑", "᱒", "᱓", "᱔", "᱕", "᱖", "᱗", "᱘", "᱙"];
2
+ /** Convert an Arabic numeral (e.g. 19) to Ol Chiki numeral string (e.g. ᱑᱙). */
3
+ export function toOlChikiNumeral(n) {
4
+ return String(n)
5
+ .split("")
6
+ .map((d) => OL_CHIKI_DIGITS[parseInt(d, 10)])
7
+ .join("");
8
+ }
9
+ //# sourceMappingURL=number.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.utils.js","sourceRoot":"","sources":["../src/number.utils.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE3E,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC;SACb,KAAK,CAAC,EAAE,CAAC;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SAC5C,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,55 @@
1
+ export type WeekDay = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
2
+ export interface SantaliFestival {
3
+ id: string;
4
+ name: string;
5
+ date: string;
6
+ santaliMonth?: string;
7
+ description?: string;
8
+ type?: "festival" | "cultural" | "community";
9
+ }
10
+ export interface SantaliMonthInfo {
11
+ days: number;
12
+ name: string;
13
+ english: string;
14
+ description?: string;
15
+ }
16
+ export interface SantaliMonth {
17
+ days: number;
18
+ name: string;
19
+ endDate: string;
20
+ english: string;
21
+ startDate: string;
22
+ description?: string;
23
+ }
24
+ export interface SantaliCalendarYear {
25
+ endDate: string;
26
+ startDate: string;
27
+ months: SantaliMonth[];
28
+ }
29
+ export interface TodaySantaliDate {
30
+ day: number;
31
+ year: number;
32
+ month: SantaliMonth;
33
+ monthIndex: number;
34
+ monthEndDate: string;
35
+ gregorianDate: string;
36
+ monthStartDate: string;
37
+ }
38
+ export type SantaliCalendar = Record<number, SantaliCalendarYear>;
39
+ export interface SantaliCalendarDay {
40
+ day: string;
41
+ date: string;
42
+ isToday: boolean;
43
+ isCurrentMonth: boolean;
44
+ }
45
+ export type SantaliCalendarDayCell = SantaliCalendarDay | null;
46
+ export interface SantaliCalendarMonth extends SantaliMonth {
47
+ weeks: Record<WeekDay, SantaliCalendarDayCell[]>;
48
+ }
49
+ export interface BuiltSantaliCalendarYear {
50
+ year: number;
51
+ endDate: string;
52
+ startDate: string;
53
+ months: SantaliCalendarMonth[];
54
+ }
55
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;CAC9C;AAED,MAAM,WAAW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AAC;IAClB,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,89 @@
1
+ import type { BuiltSantaliCalendarYear, SantaliCalendarMonth, SantaliMonth, TodaySantaliDate, WeekDay } from "./types.js";
2
+ export declare const weekDays: Record<WeekDay, string>;
3
+ export declare const santaliWeeks: string[];
4
+ export declare function formatDateShort(iso: string): string;
5
+ /**
6
+ * Normal Santali year:
7
+ *
8
+ * 12 months
9
+ * 6 × 30 days
10
+ * 6 × 29 days
11
+ *
12
+ * = 354 days
13
+ *
14
+ * Santali leap year:
15
+ *
16
+ * 354 + 30 Sarcha
17
+ * = 384 days
18
+ */
19
+ export declare function getYearDays(year: number): number;
20
+ /**
21
+ * Returns the number of base-month days.
22
+ *
23
+ * This should always be 354.
24
+ */
25
+ export declare function getBaseMonthDays(): number;
26
+ /**
27
+ * Validate the month configuration.
28
+ *
29
+ * Throws if the base months don't contain exactly 354 days.
30
+ */
31
+ export declare function validateMonths(): void;
32
+ /**
33
+ * Calculate the beginning of any Santali year from the known anchor.
34
+ *
35
+ * 2026 = YEAR_ANCHOR_DATE
36
+ *
37
+ * For future years:
38
+ * add each previous year's actual length.
39
+ *
40
+ * For previous years:
41
+ * subtract each previous year's actual length.
42
+ *
43
+ * This is important because a leap year is not necessarily 365/366 days.
44
+ */
45
+ export declare function buildYearStart(year: number, anchorYear?: number, anchorDate?: string): string;
46
+ /**
47
+ * Build all months for a particular Santali year.
48
+ *
49
+ * The month start dates are calculated automatically.
50
+ *
51
+ * Normal year:
52
+ * 12 months
53
+ *
54
+ * Leap year:
55
+ * 12 months + Sarcha
56
+ */
57
+ export declare function buildMonths(year: number, yearStartDate: string): SantaliMonth[];
58
+ /**
59
+ * Get any Santali calendar year.
60
+ *
61
+ * Works both for years before and after 2026.
62
+ */
63
+ export declare function getCalendar(year: number): BuiltSantaliCalendarYear;
64
+ /**
65
+ * Get one Santali month.
66
+ *
67
+ * 0 = Magh
68
+ * 1 = Phagun
69
+ * 2 = Chaat
70
+ * ...
71
+ * 11 = Pus
72
+ * 12 = Sarcha (leap year only)
73
+ */
74
+ export declare function getMonth(year: number, monthIndex: number): SantaliCalendarMonth;
75
+ /**
76
+ * Convert a Gregorian date into a Santali date.
77
+ *
78
+ * The year is first estimated and then corrected against
79
+ * the actual generated Santali year boundaries.
80
+ *
81
+ * This avoids assuming that every Santali year has the
82
+ * same number of days.
83
+ */
84
+ export declare function getDate(date: Date | string): TodaySantaliDate;
85
+ /**
86
+ * Get today's Santali date.
87
+ */
88
+ export declare function getToday(): TodaySantaliDate;
89
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACR,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAQnC,CAAC;AAEX,eAAO,MAAM,YAAY,UAA0B,CAAC;AAEpD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnD;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAQrC;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,SAAO,EACjB,UAAU,GAAE,MAAyB,GACpC,MAAM,CAkBR;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,YAAY,EAAE,CAuChB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAkClE;AAMD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAetB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,gBAAgB,CAkE7D;AAMD;;GAEG;AACH,wBAAgB,QAAQ,IAAI,gBAAgB,CAE3C"}
package/dist/utils.js ADDED
@@ -0,0 +1,265 @@
1
+ import { addDays, differenceInDays, formatDate, toDate } from "date-fns";
2
+ import { isLeapYear, METONIC_CYCLE_START, YEAR_ANCHOR_DATE, } from "./leap-year.utils.js";
3
+ import { months } from "./months.js";
4
+ import { buildNormalMonth } from "./calendar.utils.js";
5
+ /* -------------------------------------------------------------------------- */
6
+ /* Weekdays */
7
+ /* -------------------------------------------------------------------------- */
8
+ export const weekDays = {
9
+ sun: "ᱥᱤᱸᱜᱤ",
10
+ mon: "ᱚᱛᱮ",
11
+ tue: "ᱵᱟᱞᱮ",
12
+ wed: "ᱥᱟᱹᱜᱩᱱ",
13
+ thu: "ᱥᱟᱹᱨᱫᱤ",
14
+ fri: "ᱡᱟᱹᱨᱩᱢ",
15
+ sat: "ᱧᱩᱦᱩᱢ",
16
+ };
17
+ export const santaliWeeks = Object.values(weekDays);
18
+ export function formatDateShort(iso) {
19
+ return new Date(iso).toLocaleDateString("en-IN", {
20
+ day: "numeric",
21
+ month: "short",
22
+ year: "numeric",
23
+ });
24
+ }
25
+ /* -------------------------------------------------------------------------- */
26
+ /* Year rules */
27
+ /* -------------------------------------------------------------------------- */
28
+ /**
29
+ * Normal Santali year:
30
+ *
31
+ * 12 months
32
+ * 6 × 30 days
33
+ * 6 × 29 days
34
+ *
35
+ * = 354 days
36
+ *
37
+ * Santali leap year:
38
+ *
39
+ * 354 + 30 Sarcha
40
+ * = 384 days
41
+ */
42
+ export function getYearDays(year) {
43
+ return isLeapYear(year) ? 384 : 354;
44
+ }
45
+ /**
46
+ * Returns the number of base-month days.
47
+ *
48
+ * This should always be 354.
49
+ */
50
+ export function getBaseMonthDays() {
51
+ return months.reduce((total, month) => total + month.days, 0);
52
+ }
53
+ /**
54
+ * Validate the month configuration.
55
+ *
56
+ * Throws if the base months don't contain exactly 354 days.
57
+ */
58
+ export function validateMonths() {
59
+ const total = getBaseMonthDays();
60
+ if (total !== 354) {
61
+ throw new Error(`Invalid Santali month configuration: expected 354 days, got ${total}`);
62
+ }
63
+ }
64
+ /* -------------------------------------------------------------------------- */
65
+ /* Year start */
66
+ /* -------------------------------------------------------------------------- */
67
+ /**
68
+ * Calculate the beginning of any Santali year from the known anchor.
69
+ *
70
+ * 2026 = YEAR_ANCHOR_DATE
71
+ *
72
+ * For future years:
73
+ * add each previous year's actual length.
74
+ *
75
+ * For previous years:
76
+ * subtract each previous year's actual length.
77
+ *
78
+ * This is important because a leap year is not necessarily 365/366 days.
79
+ */
80
+ export function buildYearStart(year, anchorYear = 2026, anchorDate = YEAR_ANCHOR_DATE) {
81
+ let startDate = toDate(anchorDate);
82
+ if (year === anchorYear) {
83
+ return startDate.toISOString();
84
+ }
85
+ if (year > anchorYear) {
86
+ for (let currentYear = anchorYear; currentYear < year; currentYear++) {
87
+ startDate = addDays(startDate, getYearDays(currentYear));
88
+ }
89
+ }
90
+ else {
91
+ for (let currentYear = anchorYear - 1; currentYear >= year; currentYear--) {
92
+ startDate = addDays(startDate, -getYearDays(currentYear));
93
+ }
94
+ }
95
+ return startDate.toISOString();
96
+ }
97
+ /* -------------------------------------------------------------------------- */
98
+ /* Build months */
99
+ /* -------------------------------------------------------------------------- */
100
+ /**
101
+ * Build all months for a particular Santali year.
102
+ *
103
+ * The month start dates are calculated automatically.
104
+ *
105
+ * Normal year:
106
+ * 12 months
107
+ *
108
+ * Leap year:
109
+ * 12 months + Sarcha
110
+ */
111
+ export function buildMonths(year, yearStartDate) {
112
+ validateMonths();
113
+ let startDate = toDate(yearStartDate);
114
+ const yearMonths = months.map((month) => {
115
+ const endDate = addDays(startDate, month.days - 1);
116
+ const result = {
117
+ ...month,
118
+ startDate: startDate.toISOString(),
119
+ endDate: endDate.toISOString(),
120
+ };
121
+ startDate = addDays(startDate, month.days);
122
+ return result;
123
+ });
124
+ /*
125
+ * Leap year:
126
+ *
127
+ * Add the additional Sarcha month.
128
+ */
129
+ if (isLeapYear(year)) {
130
+ const sarchaDays = 30;
131
+ const endDate = addDays(startDate, sarchaDays - 1);
132
+ yearMonths.push({
133
+ days: sarchaDays,
134
+ name: "ᱥᱚᱨᱪᱟ",
135
+ english: "Sarcha",
136
+ startDate: startDate.toISOString(),
137
+ endDate: endDate.toISOString(),
138
+ });
139
+ }
140
+ return yearMonths;
141
+ }
142
+ /**
143
+ * Get any Santali calendar year.
144
+ *
145
+ * Works both for years before and after 2026.
146
+ */
147
+ export function getCalendar(year) {
148
+ if (!Number.isInteger(year)) {
149
+ throw new TypeError(`Santali year must be an integer: ${year}`);
150
+ }
151
+ const startDate = buildYearStart(year);
152
+ const yearMonths = buildMonths(year, startDate);
153
+ const totalDays = yearMonths.reduce((total, month) => total + month.days, 0);
154
+ const expectedDays = getYearDays(year);
155
+ if (totalDays !== expectedDays) {
156
+ throw new Error(`Invalid ${year} Santali calendar: ` +
157
+ `expected ${expectedDays} days, ` +
158
+ `got ${totalDays} days`);
159
+ }
160
+ const endDate = addDays(toDate(startDate), totalDays - 1);
161
+ return {
162
+ year,
163
+ endDate: formatDate(endDate, "yyyy-MM-dd"),
164
+ startDate: formatDate(startDate, "yyyy-MM-dd"),
165
+ months: yearMonths.map((month, index) => {
166
+ return buildNormalMonth(month, yearMonths[index - 1], yearMonths[index + 1]);
167
+ }),
168
+ };
169
+ }
170
+ /* -------------------------------------------------------------------------- */
171
+ /* Get month */
172
+ /* -------------------------------------------------------------------------- */
173
+ /**
174
+ * Get one Santali month.
175
+ *
176
+ * 0 = Magh
177
+ * 1 = Phagun
178
+ * 2 = Chaat
179
+ * ...
180
+ * 11 = Pus
181
+ * 12 = Sarcha (leap year only)
182
+ */
183
+ export function getMonth(year, monthIndex) {
184
+ if (!Number.isInteger(monthIndex)) {
185
+ throw new TypeError(`Month index must be an integer: ${monthIndex}`);
186
+ }
187
+ const calendarYear = getCalendar(year);
188
+ const month = calendarYear.months[monthIndex];
189
+ if (!month) {
190
+ throw new RangeError(`Invalid Santali month index ${monthIndex} for year ${year}`);
191
+ }
192
+ return month;
193
+ }
194
+ /**
195
+ * Convert a Gregorian date into a Santali date.
196
+ *
197
+ * The year is first estimated and then corrected against
198
+ * the actual generated Santali year boundaries.
199
+ *
200
+ * This avoids assuming that every Santali year has the
201
+ * same number of days.
202
+ */
203
+ export function getDate(date) {
204
+ const currentDate = toDate(formatDate(date, "yyyy-MM-dd"));
205
+ const anchorDate = toDate(YEAR_ANCHOR_DATE);
206
+ const anchorYear = METONIC_CYCLE_START;
207
+ const diffDays = differenceInDays(currentDate, anchorDate);
208
+ /*
209
+ * Approximation only.
210
+ *
211
+ * We use 354 because that is the normal
212
+ * Santali year length.
213
+ *
214
+ * The result is corrected below.
215
+ */
216
+ let year = anchorYear + Math.floor(diffDays / 354);
217
+ let calendarYear = getCalendar(year);
218
+ /*
219
+ * If the estimated year is too far ahead,
220
+ * move backwards.
221
+ */
222
+ while (currentDate < toDate(calendarYear.startDate)) {
223
+ year--;
224
+ calendarYear = getCalendar(year);
225
+ }
226
+ /*
227
+ * If the estimated year is too far behind,
228
+ * move forwards.
229
+ */
230
+ while (currentDate > toDate(calendarYear.endDate)) {
231
+ year++;
232
+ calendarYear = getCalendar(year);
233
+ }
234
+ /* ------------------------------------------------------------------------ */
235
+ /* Find month */
236
+ /* ------------------------------------------------------------------------ */
237
+ for (let monthIndex = 0; monthIndex < calendarYear.months.length; monthIndex++) {
238
+ const month = calendarYear.months[monthIndex];
239
+ const monthStart = toDate(month.startDate);
240
+ const monthEnd = toDate(month.endDate);
241
+ if (currentDate >= monthStart && currentDate <= monthEnd) {
242
+ const day = differenceInDays(currentDate, monthStart) + 1;
243
+ return {
244
+ day,
245
+ year,
246
+ month,
247
+ monthIndex,
248
+ monthEndDate: formatDate(monthEnd, "yyyy-MM-dd"),
249
+ monthStartDate: formatDate(monthStart, "yyyy-MM-dd"),
250
+ gregorianDate: formatDate(currentDate, "yyyy-MM-dd"),
251
+ };
252
+ }
253
+ }
254
+ throw new Error(`Could not determine Santali date for ${formatDate(currentDate, "yyyy-MM-dd")}`);
255
+ }
256
+ /* -------------------------------------------------------------------------- */
257
+ /* Today */
258
+ /* -------------------------------------------------------------------------- */
259
+ /**
260
+ * Get today's Santali date.
261
+ */
262
+ export function getToday() {
263
+ return getDate(new Date());
264
+ }
265
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AASvD,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC/C,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACJ,CAAC;AAEX,MAAM,CA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GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAC7B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@wesantal/santali-calendar",
3
+ "version": "1.0.0",
4
+ "description": "A framework-independent Santali Calendar data and utility package for JavaScript and TypeScript applications.",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc --project tsconfig.build.json",
24
+ "test": "vitest run",
25
+ "test:watch": "vitest",
26
+ "lint": "tsc --noEmit",
27
+ "clean": "rimraf dist"
28
+ },
29
+ "keywords": [
30
+ "santali",
31
+ "calendar",
32
+ "santali-calendar",
33
+ "adivasi",
34
+ "tribal",
35
+ "indigenous",
36
+ "india",
37
+ "jharkhand"
38
+ ],
39
+ "author": {
40
+ "name": "WeSantal",
41
+ "email": "official.wesantal@gmail.com",
42
+ "url": "https://wesantal.org"
43
+ },
44
+ "license": "MIT",
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "engines": {
49
+ "node": ">=18"
50
+ },
51
+ "devDependencies": {
52
+ "typescript": "~6.0.3",
53
+ "vitest": "^3.2.4"
54
+ },
55
+ "dependencies": {
56
+ "date-fns": "^4.4.0"
57
+ }
58
+ }