@timestamp-js/calendar-saka 0.1.0-rc.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.
- package/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +124 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jeff Galbraith
|
|
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,46 @@
|
|
|
1
|
+
# @timestamp-js/calendar-saka
|
|
2
|
+
|
|
3
|
+
Indian National Calendar (Saka) adapter for `@timestamp-js/core`.
|
|
4
|
+
|
|
5
|
+
The adapter is `indianNationalCalendar`, with `sakaCalendar` as a convenience alias. It models the
|
|
6
|
+
official Indian National Calendar using deterministic Gregorian-aligned leap-year rules.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import {
|
|
10
|
+
createCalendarDayList,
|
|
11
|
+
getCalendarEndOfMonth,
|
|
12
|
+
getCalendarEndOfWeek,
|
|
13
|
+
getCalendarStartOfMonth,
|
|
14
|
+
getCalendarStartOfWeek,
|
|
15
|
+
gregorianCalendar,
|
|
16
|
+
parseCalendarTimestamp,
|
|
17
|
+
} from '@timestamp-js/core'
|
|
18
|
+
import { indianNationalCalendar } from '@timestamp-js/calendar-saka'
|
|
19
|
+
|
|
20
|
+
const sakaNewYear = { year: 1946, month: 1, day: 1 }
|
|
21
|
+
const gregorian = gregorianCalendar.fromEpochDay(indianNationalCalendar.toEpochDay(sakaNewYear))
|
|
22
|
+
|
|
23
|
+
gregorian // { year: 2024, month: 3, day: 21 }
|
|
24
|
+
|
|
25
|
+
const visible = parseCalendarTimestamp('1946-01-15', indianNationalCalendar)!
|
|
26
|
+
const weekdays = [0, 1, 2, 3, 4, 5, 6]
|
|
27
|
+
|
|
28
|
+
const weekStart = getCalendarStartOfWeek(visible, weekdays, indianNationalCalendar)
|
|
29
|
+
const weekEnd = getCalendarEndOfWeek(visible, weekdays, indianNationalCalendar)
|
|
30
|
+
const weekDays = createCalendarDayList(weekStart, weekEnd, visible, indianNationalCalendar)
|
|
31
|
+
|
|
32
|
+
weekStart.date // '1946-01-11'
|
|
33
|
+
weekEnd.date // '1946-01-17'
|
|
34
|
+
weekDays.length // 7
|
|
35
|
+
|
|
36
|
+
const monthStart = getCalendarStartOfMonth(visible, indianNationalCalendar)
|
|
37
|
+
const monthEnd = getCalendarEndOfMonth(visible, indianNationalCalendar)
|
|
38
|
+
const monthDays = createCalendarDayList(monthStart, monthEnd, visible, indianNationalCalendar)
|
|
39
|
+
|
|
40
|
+
monthStart.date // '1946-01-01'
|
|
41
|
+
monthEnd.date // '1946-01-31'
|
|
42
|
+
monthDays.length // 31
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This package is early calendar-adapter work. Treat the adapter contract as release-candidate API
|
|
46
|
+
until `@timestamp-js/core` reaches a stable `1.0.0`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CalendarSystem } from '@timestamp-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true when the Saka year begins in a Gregorian leap year.
|
|
4
|
+
*
|
|
5
|
+
* @param year Saka year number.
|
|
6
|
+
* @returns True when Chaitra has 31 days.
|
|
7
|
+
* @category calendar
|
|
8
|
+
*/
|
|
9
|
+
export declare function isSakaLeapYear(year: number): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Returns days in an Indian National Calendar (Saka) month.
|
|
12
|
+
*
|
|
13
|
+
* @param year Saka year number.
|
|
14
|
+
* @param month Saka month number, where Chaitra is `1`.
|
|
15
|
+
* @returns Number of days in the month, or `0` for an invalid month number.
|
|
16
|
+
* @category calendar
|
|
17
|
+
*/
|
|
18
|
+
export declare function sakaDaysInMonth(year: number, month: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Deterministic Indian National Calendar (Saka) adapter.
|
|
21
|
+
*
|
|
22
|
+
* Saka year `1` begins in Gregorian year `79`. A Saka year starts on March 21
|
|
23
|
+
* when the corresponding Gregorian year is leap, and March 22 otherwise.
|
|
24
|
+
*/
|
|
25
|
+
export declare const indianNationalCalendar: CalendarSystem;
|
|
26
|
+
/**
|
|
27
|
+
* Alias for the default Saka adapter exported by this package.
|
|
28
|
+
*/
|
|
29
|
+
export declare const sakaCalendar: CalendarSystem;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAqC3E;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAYnE;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAwEnC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,gBAAyB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { gregorianCalendar } from '@timestamp-js/core';
|
|
2
|
+
const GREGORIAN_YEAR_OFFSET = 78;
|
|
3
|
+
const MONTHS_IN_YEAR = 12;
|
|
4
|
+
const SAKA_DAYS_IN_MONTH_COMMON = [0, 30, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30];
|
|
5
|
+
const SAKA_DAYS_IN_MONTH_LEAP = [0, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30];
|
|
6
|
+
function assertPositiveYear(year) {
|
|
7
|
+
if (year < 1) {
|
|
8
|
+
throw new RangeError('Saka calendar years start at 1.');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function getGregorianYearForSakaYear(year) {
|
|
12
|
+
assertPositiveYear(year);
|
|
13
|
+
return year + GREGORIAN_YEAR_OFFSET;
|
|
14
|
+
}
|
|
15
|
+
function getSakaYearStartEpochDay(year) {
|
|
16
|
+
const gregorianYear = getGregorianYearForSakaYear(year);
|
|
17
|
+
return gregorianCalendar.toEpochDay({
|
|
18
|
+
year: gregorianYear,
|
|
19
|
+
month: 3,
|
|
20
|
+
day: gregorianCalendar.isLeapYear(gregorianYear) === true ? 21 : 22,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function daysBeforeMonth(year, month) {
|
|
24
|
+
let days = 0;
|
|
25
|
+
for (let currentMonth = 1; currentMonth < month; currentMonth += 1) {
|
|
26
|
+
days += sakaDaysInMonth(year, currentMonth);
|
|
27
|
+
}
|
|
28
|
+
return days;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns true when the Saka year begins in a Gregorian leap year.
|
|
32
|
+
*
|
|
33
|
+
* @param year Saka year number.
|
|
34
|
+
* @returns True when Chaitra has 31 days.
|
|
35
|
+
* @category calendar
|
|
36
|
+
*/
|
|
37
|
+
export function isSakaLeapYear(year) {
|
|
38
|
+
return gregorianCalendar.isLeapYear(getGregorianYearForSakaYear(year));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns days in an Indian National Calendar (Saka) month.
|
|
42
|
+
*
|
|
43
|
+
* @param year Saka year number.
|
|
44
|
+
* @param month Saka month number, where Chaitra is `1`.
|
|
45
|
+
* @returns Number of days in the month, or `0` for an invalid month number.
|
|
46
|
+
* @category calendar
|
|
47
|
+
*/
|
|
48
|
+
export function sakaDaysInMonth(year, month) {
|
|
49
|
+
assertPositiveYear(year);
|
|
50
|
+
if (month < 1 || month > MONTHS_IN_YEAR) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
return (isSakaLeapYear(year) === true
|
|
54
|
+
? SAKA_DAYS_IN_MONTH_LEAP[month]
|
|
55
|
+
: SAKA_DAYS_IN_MONTH_COMMON[month]);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Deterministic Indian National Calendar (Saka) adapter.
|
|
59
|
+
*
|
|
60
|
+
* Saka year `1` begins in Gregorian year `79`. A Saka year starts on March 21
|
|
61
|
+
* when the corresponding Gregorian year is leap, and March 22 otherwise.
|
|
62
|
+
*/
|
|
63
|
+
export const indianNationalCalendar = Object.freeze({
|
|
64
|
+
id: 'saka',
|
|
65
|
+
intlCalendar: 'indian',
|
|
66
|
+
label: 'Indian National (Saka)',
|
|
67
|
+
monthsInYear() {
|
|
68
|
+
return MONTHS_IN_YEAR;
|
|
69
|
+
},
|
|
70
|
+
isLeapYear(year) {
|
|
71
|
+
return isSakaLeapYear(year);
|
|
72
|
+
},
|
|
73
|
+
daysInMonth(year, month) {
|
|
74
|
+
return sakaDaysInMonth(year, month);
|
|
75
|
+
},
|
|
76
|
+
toEpochDay(date) {
|
|
77
|
+
assertPositiveYear(date.year);
|
|
78
|
+
return (getSakaYearStartEpochDay(date.year) + daysBeforeMonth(date.year, date.month) + date.day - 1);
|
|
79
|
+
},
|
|
80
|
+
fromEpochDay(epochDay) {
|
|
81
|
+
const gregorianDate = gregorianCalendar.fromEpochDay(epochDay);
|
|
82
|
+
let year = gregorianDate.year - GREGORIAN_YEAR_OFFSET;
|
|
83
|
+
let yearStart = getSakaYearStartEpochDay(year);
|
|
84
|
+
if (epochDay < yearStart) {
|
|
85
|
+
year -= 1;
|
|
86
|
+
yearStart = getSakaYearStartEpochDay(year);
|
|
87
|
+
}
|
|
88
|
+
let dayOfYear = epochDay - yearStart;
|
|
89
|
+
let month = 1;
|
|
90
|
+
while (month < MONTHS_IN_YEAR) {
|
|
91
|
+
const daysInCurrentMonth = this.daysInMonth(year, month);
|
|
92
|
+
if (dayOfYear < daysInCurrentMonth) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
dayOfYear -= daysInCurrentMonth;
|
|
96
|
+
month += 1;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
year,
|
|
100
|
+
month,
|
|
101
|
+
day: dayOfYear + 1,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
addDays(date, amount) {
|
|
105
|
+
return this.fromEpochDay(this.toEpochDay(date) + amount);
|
|
106
|
+
},
|
|
107
|
+
nextDay(date) {
|
|
108
|
+
return this.addDays(date, 1);
|
|
109
|
+
},
|
|
110
|
+
prevDay(date) {
|
|
111
|
+
return this.addDays(date, -1);
|
|
112
|
+
},
|
|
113
|
+
getDayOfYear(date) {
|
|
114
|
+
return this.toEpochDay(date) - this.toEpochDay({ year: date.year, month: 1, day: 1 }) + 1;
|
|
115
|
+
},
|
|
116
|
+
getWeekday(date) {
|
|
117
|
+
return gregorianCalendar.getWeekday(gregorianCalendar.fromEpochDay(this.toEpochDay(date)));
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* Alias for the default Saka adapter exported by this package.
|
|
122
|
+
*/
|
|
123
|
+
export const sakaCalendar = indianNationalCalendar;
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAGtD,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAChC,MAAM,cAAc,GAAG,EAAE,CAAA;AACzB,MAAM,yBAAyB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AACrF,MAAM,uBAAuB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEnF,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,UAAU,CAAC,iCAAiC,CAAC,CAAA;IACzD,CAAC;AACH,CAAC;AAED,SAAS,2BAA2B,CAAC,IAAY;IAC/C,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAI,GAAG,qBAAqB,CAAA;AACrC,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,MAAM,aAAa,GA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,CAAC;SACnB,CAAA;IACH,CAAC;IAED,OAAO,CAAC,IAAuB,EAAE,MAAc;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,CAAC,IAAuB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC9B,CAAC;IAED,OAAO,CAAC,IAAuB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC;IAED,YAAY,CAAC,IAAuB;QAClC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IAC3F,CAAC;IAED,UAAU,CAAC,IAAuB;QAChC,OAAO,iBAAiB,CAAC,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC5F,CAAC;CACF,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@timestamp-js/calendar-saka",
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"description": "Indian National Calendar (Saka) adapter for Timestamp.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"calendar",
|
|
7
|
+
"date",
|
|
8
|
+
"indian",
|
|
9
|
+
"saka",
|
|
10
|
+
"timestamp",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/hawkeye64/timestamp#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/hawkeye64/timestamp/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Jeff <galbraith64@gmail.com>",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/hawkeye64/timestamp.git"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@timestamp-js/core": "0.1.0-rc.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "26.0.1",
|
|
46
|
+
"oxfmt": "0.56.0",
|
|
47
|
+
"oxlint": "1.71.0",
|
|
48
|
+
"typescript": "6.0.3",
|
|
49
|
+
"vitest": "4.1.9"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.13",
|
|
53
|
+
"pnpm": ">=11.5.0"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"clean": "rm -rf dist node_modules",
|
|
57
|
+
"prebuild": "pnpm --filter @timestamp-js/core build",
|
|
58
|
+
"build": "tsc -p tsconfig.build.json",
|
|
59
|
+
"format": "oxfmt",
|
|
60
|
+
"format:check": "oxfmt --check",
|
|
61
|
+
"lint": "oxlint",
|
|
62
|
+
"lint:fix": "oxlint --fix",
|
|
63
|
+
"pretest": "pnpm --filter @timestamp-js/core build",
|
|
64
|
+
"test": "vitest run",
|
|
65
|
+
"pretypecheck": "pnpm --filter @timestamp-js/core build",
|
|
66
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
67
|
+
"verify": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build"
|
|
68
|
+
}
|
|
69
|
+
}
|