@sonill/nepali-dates 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 +376 -0
- package/data/README.md +84 -0
- package/data/calendar-data.json +105 -0
- package/data/reference-dates.json +50 -0
- package/dist/index.d.mts +371 -0
- package/dist/index.d.ts +371 -0
- package/dist/index.js +682 -0
- package/dist/index.mjs +624 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nepali Dates Contributors
|
|
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,376 @@
|
|
|
1
|
+
# Nepali Dates
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/nepali-dates)
|
|
4
|
+
[](https://github.com/sonill/nepali-dates/actions/workflows/test.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
|
|
8
|
+
Community-driven, accurate Nepali calendar (Bikram Sambat) data and conversion utilities. A trustable source for Nepali date calculations with zero dependencies.
|
|
9
|
+
|
|
10
|
+
Use this package instead of maintaining your own source of datas.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Accurate Data**: 101 years (BS 2000-2100) of verified Nepali calendar data
|
|
15
|
+
- **Zero Dependencies**: Lightweight and reliable
|
|
16
|
+
- **Type-Safe**: Full TypeScript support with type definitions
|
|
17
|
+
- **Multiple Formats**: Support for object, ISO, string, and array formats
|
|
18
|
+
- **Well-Tested**: >95% test coverage with extensive validation
|
|
19
|
+
- **Community-Driven**: Open data sources and transparent validation
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install nepali-dates
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add nepali-dates
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add nepali-dates
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { bsToAd, adToBs, getTotalDaysInMonth } from 'nepali-dates';
|
|
39
|
+
|
|
40
|
+
// Convert Nepali date to English date
|
|
41
|
+
const englishDate = bsToAd(2080, 10, 15);
|
|
42
|
+
console.log(englishDate); // { year: 2024, month: 1, day: 27 }
|
|
43
|
+
|
|
44
|
+
// Convert English date to Nepali date
|
|
45
|
+
const nepaliDate = adToBs(2024, 1, 27);
|
|
46
|
+
console.log(nepaliDate); // { year: 2080, month: 10, day: 15 }
|
|
47
|
+
|
|
48
|
+
// Get days in a Nepali month
|
|
49
|
+
const days = getTotalDaysInMonth(2080, 1);
|
|
50
|
+
console.log(days); // 31
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## API Reference
|
|
54
|
+
|
|
55
|
+
### Date Conversion
|
|
56
|
+
|
|
57
|
+
#### `bsToAd(year, month, day, options?)`
|
|
58
|
+
|
|
59
|
+
Convert Bikram Sambat (BS) date to Anno Domini (AD) date.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// Default: returns object
|
|
63
|
+
bsToAd(2080, 10, 15);
|
|
64
|
+
// { year: 2024, month: 1, day: 27 }
|
|
65
|
+
|
|
66
|
+
// ISO format
|
|
67
|
+
bsToAd(2080, 10, 15, { format: 'iso' });
|
|
68
|
+
// "2024-01-27"
|
|
69
|
+
|
|
70
|
+
// Custom string format
|
|
71
|
+
bsToAd(2080, 10, 15, { format: 'string', pattern: 'DD/MM/YYYY' });
|
|
72
|
+
// "27/01/2024"
|
|
73
|
+
|
|
74
|
+
// Array format
|
|
75
|
+
bsToAd(2080, 10, 15, { format: 'array' });
|
|
76
|
+
// [2024, 1, 27]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### `adToBs(year, month, day, options?)`
|
|
80
|
+
|
|
81
|
+
Convert Anno Domini (AD) date to Bikram Sambat (BS) date.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// Default: returns object
|
|
85
|
+
adToBs(2024, 1, 27);
|
|
86
|
+
// { year: 2080, month: 10, day: 15 }
|
|
87
|
+
|
|
88
|
+
// ISO format
|
|
89
|
+
adToBs(2024, 1, 27, { format: 'iso' });
|
|
90
|
+
// "2080-10-15"
|
|
91
|
+
|
|
92
|
+
// Array format
|
|
93
|
+
adToBs(2024, 1, 27, { format: 'array' });
|
|
94
|
+
// [2080, 10, 15]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Utility Functions
|
|
98
|
+
|
|
99
|
+
#### `getTotalDaysInMonth(year, month)`
|
|
100
|
+
|
|
101
|
+
Get the total number of days in a Nepali month.
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
getTotalDaysInMonth(2080, 1); // 31
|
|
105
|
+
getTotalDaysInMonth(2080, 2); // 32
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### `getTotalDaysInYear(year)`
|
|
109
|
+
|
|
110
|
+
Get the total number of days in a Nepali year.
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
getTotalDaysInYear(2080); // 366
|
|
114
|
+
getTotalDaysInYear(2081); // 365
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### `getNextMonth(year, month)`
|
|
118
|
+
|
|
119
|
+
Get the next month.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
getNextMonth(2080, 6); // { year: 2080, month: 7 }
|
|
123
|
+
getNextMonth(2080, 12); // { year: 2081, month: 1 }
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### `getPrevMonth(year, month)`
|
|
127
|
+
|
|
128
|
+
Get the previous month.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
getPrevMonth(2080, 7); // { year: 2080, month: 6 }
|
|
132
|
+
getPrevMonth(2080, 1); // { year: 2079, month: 12 }
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### `getDaysInRange(fromYear, fromMonth, fromDay, toYear, toMonth, toDay)`
|
|
136
|
+
|
|
137
|
+
Calculate the number of days between two BS dates.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
getDaysInRange(2080, 1, 1, 2080, 1, 31); // 30
|
|
141
|
+
getDaysInRange(2080, 1, 1, 2081, 1, 1); // 366
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Formatting Functions
|
|
145
|
+
|
|
146
|
+
#### `formatBsDate(year, month, day, options?)`
|
|
147
|
+
|
|
148
|
+
Format a BS date to string.
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
formatBsDate(2080, 10, 15); // "2080-10-15"
|
|
152
|
+
formatBsDate(2080, 10, 15, { pattern: 'DD/MM/YYYY' }); // "15/10/2080"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### `getNepaliMonthName(month, locale?)`
|
|
156
|
+
|
|
157
|
+
Get Nepali month name.
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
getNepaliMonthName(1); // "Baisakh"
|
|
161
|
+
getNepaliMonthName(1, 'ne'); // "बैशाख"
|
|
162
|
+
getNepaliMonthName(2); // "Jestha"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### `parseDate(dateString, pattern?)`
|
|
166
|
+
|
|
167
|
+
Parse a date string to DateObject.
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
parseDate('2080-10-15'); // { year: 2080, month: 10, day: 15 }
|
|
171
|
+
parseDate('15/10/2080', 'DD/MM/YYYY'); // { year: 2080, month: 10, day: 15 }
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Validation Functions
|
|
175
|
+
|
|
176
|
+
#### `isValidBsDate(year, month, day)`
|
|
177
|
+
|
|
178
|
+
Validate a BS date.
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
isValidBsDate(2080, 1, 1); // true
|
|
182
|
+
isValidBsDate(2080, 13, 1); // false
|
|
183
|
+
isValidBsDate(2080, 1, 32); // false
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### `isValidAdDate(year, month, day)`
|
|
187
|
+
|
|
188
|
+
Validate an AD date.
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
isValidAdDate(2024, 1, 27); // true
|
|
192
|
+
isValidAdDate(2024, 2, 30); // false
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### `hasDataForYear(year)`
|
|
196
|
+
|
|
197
|
+
Check if calendar data exists for a year.
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
hasDataForYear(2080); // true
|
|
201
|
+
hasDataForYear(1999); // false
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Data Access
|
|
205
|
+
|
|
206
|
+
#### `getCalendarData(year)`
|
|
207
|
+
|
|
208
|
+
Get calendar data for a specific year.
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
getCalendarData(2080);
|
|
212
|
+
// [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
#### `getDataRange()`
|
|
216
|
+
|
|
217
|
+
Get the available data range.
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
getDataRange();
|
|
221
|
+
// { minYear: 2000, maxYear: 2100, totalYears: 101 }
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Types
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
type DateFormat = 'object' | 'iso' | 'string' | 'array';
|
|
228
|
+
type DatePattern = 'YYYY-MM-DD' | 'YYYY/MM/DD' | 'DD-MM-YYYY' | 'DD/MM/YYYY' | 'MM-DD-YYYY' | 'MM/DD/YYYY';
|
|
229
|
+
type Locale = 'en' | 'ne';
|
|
230
|
+
|
|
231
|
+
interface DateObject {
|
|
232
|
+
year: number;
|
|
233
|
+
month: number;
|
|
234
|
+
day: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface ConversionOptions {
|
|
238
|
+
format?: DateFormat;
|
|
239
|
+
pattern?: DatePattern;
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Data Range
|
|
244
|
+
|
|
245
|
+
- **BS Years**: 2000 - 2100
|
|
246
|
+
- **AD Years**: 1943 - 2043
|
|
247
|
+
- **Total Years**: 101 years of data
|
|
248
|
+
|
|
249
|
+
## Using Calendar Data in Other Languages
|
|
250
|
+
|
|
251
|
+
The calendar data is available as JSON files in the [data/](data/) directory, making it accessible from any programming language. This is particularly useful if you want to use the Nepali calendar data without the JavaScript conversion utilities.
|
|
252
|
+
|
|
253
|
+
### Direct JSON Access
|
|
254
|
+
|
|
255
|
+
You can access the raw calendar data from:
|
|
256
|
+
|
|
257
|
+
- **Calendar Data**: [data/calendar-data.json](data/calendar-data.json)
|
|
258
|
+
- **Reference Dates**: [data/reference-dates.json](data/reference-dates.json)
|
|
259
|
+
|
|
260
|
+
### Examples in Other Languages
|
|
261
|
+
|
|
262
|
+
**Python:**
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
import json
|
|
266
|
+
import urllib.request
|
|
267
|
+
|
|
268
|
+
# Load calendar data from GitHub or your local installation
|
|
269
|
+
with open('data/calendar-data.json') as f:
|
|
270
|
+
calendar_data = json.load(f)
|
|
271
|
+
|
|
272
|
+
# Get days in each month for BS 2080
|
|
273
|
+
year_2080 = calendar_data['2080']
|
|
274
|
+
print(year_2080) # [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**PHP:**
|
|
278
|
+
|
|
279
|
+
```php
|
|
280
|
+
<?php
|
|
281
|
+
$calendarData = json_decode(file_get_contents('data/calendar-data.json'), true);
|
|
282
|
+
$year2080 = $calendarData['2080'];
|
|
283
|
+
print_r($year2080);
|
|
284
|
+
?>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Ruby:**
|
|
288
|
+
|
|
289
|
+
```ruby
|
|
290
|
+
require 'json'
|
|
291
|
+
|
|
292
|
+
calendar_data = JSON.parse(File.read('data/calendar-data.json'))
|
|
293
|
+
year_2080 = calendar_data['2080']
|
|
294
|
+
puts year_2080
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Go:**
|
|
298
|
+
|
|
299
|
+
```go
|
|
300
|
+
package main
|
|
301
|
+
|
|
302
|
+
import (
|
|
303
|
+
"encoding/json"
|
|
304
|
+
"os"
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
type CalendarData map[string][]int
|
|
308
|
+
|
|
309
|
+
func main() {
|
|
310
|
+
file, _ := os.Open("data/calendar-data.json")
|
|
311
|
+
defer file.Close()
|
|
312
|
+
|
|
313
|
+
var data CalendarData
|
|
314
|
+
json.NewDecoder(file).Decode(&data)
|
|
315
|
+
|
|
316
|
+
year2080 := data["2080"]
|
|
317
|
+
println(year2080)
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Data Format
|
|
322
|
+
|
|
323
|
+
The JSON files are structured for easy parsing:
|
|
324
|
+
|
|
325
|
+
- Each year is a string key (e.g., "2080")
|
|
326
|
+
- Each value is an array of 12 integers representing days in each month
|
|
327
|
+
- Months follow the order: [Baisakh, Jestha, Ashar, Shrawan, Bhadra, Ashwin, Kartik, Mangsir, Poush, Magh, Falgun, Chaitra]
|
|
328
|
+
- Base reference: BS 2000-01-01 = AD 1943-04-14
|
|
329
|
+
|
|
330
|
+
See [data/README.md](data/README.md) for detailed documentation on the data structure and how to contribute updates.
|
|
331
|
+
|
|
332
|
+
## Data Sources
|
|
333
|
+
|
|
334
|
+
The calendar data has been compiled and verified from:
|
|
335
|
+
- Nepal Panchanga Nirnayak Samiti (official source)
|
|
336
|
+
- Historical records and government publications
|
|
337
|
+
- Cross-referenced with multiple existing implementations
|
|
338
|
+
- Community contributions and verification
|
|
339
|
+
|
|
340
|
+
## Contributing
|
|
341
|
+
|
|
342
|
+
We welcome contributions! Please see [CONTRIBUTING.md](docs/CONTRIBUTING.md) for guidelines.
|
|
343
|
+
|
|
344
|
+
### Adding New Year Data
|
|
345
|
+
|
|
346
|
+
When adding new year data, please:
|
|
347
|
+
1. Provide at least 2 verified sources
|
|
348
|
+
2. Follow the contribution template
|
|
349
|
+
3. Include test cases
|
|
350
|
+
4. Update reference dates if applicable
|
|
351
|
+
|
|
352
|
+
## Browser Support
|
|
353
|
+
|
|
354
|
+
Works in all modern browsers and Node.js 16+.
|
|
355
|
+
|
|
356
|
+
## Bundle Size
|
|
357
|
+
|
|
358
|
+
< 10KB minified (zero dependencies)
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
363
|
+
|
|
364
|
+
## Acknowledgments
|
|
365
|
+
|
|
366
|
+
Thanks to all contributors and the Nepali developer community for maintaining accurate calendar data.
|
|
367
|
+
|
|
368
|
+
## Links
|
|
369
|
+
|
|
370
|
+
- [GitHub Repository](https://github.com/yourusername/nepali-dates)
|
|
371
|
+
- [Issue Tracker](https://github.com/yourusername/nepali-dates/issues)
|
|
372
|
+
- [NPM Package](https://www.npmjs.com/package/nepali-dates)
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
Made with ❤️ by the Nepali developer community
|
package/data/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Calendar Data Files
|
|
2
|
+
|
|
3
|
+
This directory contains the core calendar data in JSON format, making it easy to edit and maintain.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
### calendar-data.json
|
|
8
|
+
|
|
9
|
+
Contains the Nepali calendar data (Bikram Sambat) from BS 2000 to BS 2100 (AD 1943-2043).
|
|
10
|
+
|
|
11
|
+
**Structure:**
|
|
12
|
+
- Each year is a key (e.g., "2000", "2001")
|
|
13
|
+
- Each value is an array of 12 numbers representing days in each month
|
|
14
|
+
- Months order: [Baisakh, Jestha, Ashar, Shrawan, Bhadra, Ashwin, Kartik, Mangsir, Poush, Magh, Falgun, Chaitra]
|
|
15
|
+
|
|
16
|
+
**Example:**
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"2000": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
20
|
+
"2001": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30]
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Validation rules:**
|
|
25
|
+
- Each year must have exactly 12 months
|
|
26
|
+
- Each month must have between 29 and 32 days
|
|
27
|
+
- Total days in a year should be between 354 and 385
|
|
28
|
+
|
|
29
|
+
### reference-dates.json
|
|
30
|
+
|
|
31
|
+
Contains verified BS-AD date pairs used for validation and testing.
|
|
32
|
+
|
|
33
|
+
**Structure:**
|
|
34
|
+
- `referenceDates`: Array of date pairs with BS and AD equivalents
|
|
35
|
+
|
|
36
|
+
**Example:**
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"referenceDates": [
|
|
40
|
+
{
|
|
41
|
+
"bs": { "year": 2001, "month": 1, "day": 1 },
|
|
42
|
+
"ad": { "year": 1944, "month": 4, "day": 13 }
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"bs": { "year": 2010, "month": 1, "day": 1 },
|
|
46
|
+
"ad": { "year": 1953, "month": 4, "day": 13 }
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Note:** The base reference point (BS 2000-01-01 = AD 1943-04-14) is defined as a constant in the code and should not be included in this file.
|
|
53
|
+
|
|
54
|
+
## How to Edit
|
|
55
|
+
|
|
56
|
+
1. Open the JSON file in any text editor
|
|
57
|
+
2. Make your changes following the structure above
|
|
58
|
+
3. Save the file
|
|
59
|
+
4. Run tests to verify your changes:
|
|
60
|
+
```bash
|
|
61
|
+
npm test
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Data Sources
|
|
65
|
+
|
|
66
|
+
The calendar data comes from:
|
|
67
|
+
- Nepal Panchanga Nirnayak Samiti (official calendar authority)
|
|
68
|
+
- Historical records and verified events
|
|
69
|
+
- Cross-referenced with multiple calendar systems
|
|
70
|
+
|
|
71
|
+
## Contributing
|
|
72
|
+
|
|
73
|
+
When adding or modifying data:
|
|
74
|
+
1. Always verify against official sources
|
|
75
|
+
2. Add reference date pairs for significant dates
|
|
76
|
+
3. Run the validation script: `npm run validate-data`
|
|
77
|
+
4. Run all tests to ensure consistency: `npm test`
|
|
78
|
+
5. Document your sources in commit messages
|
|
79
|
+
|
|
80
|
+
## Notes
|
|
81
|
+
|
|
82
|
+
- The `$schema` and `description` fields in the JSON files are metadata and are ignored by the application
|
|
83
|
+
- Month numbers are 1-indexed (1 = Baisakh, 12 = Chaitra)
|
|
84
|
+
- Day numbers are 1-indexed (1 = first day of month)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"description": "Nepali Calendar Data (Bikram Sambat). Each year maps to an array of 12 numbers representing the days in each month. Months: [Baisakh, Jestha, Ashar, Shrawan, Bhadra, Ashwin, Kartik, Mangsir, Poush, Magh, Falgun, Chaitra]. Data Sources: Nepal Panchanga Nirnayak Samiti, verified against historical records. Data Range: BS 2000 - 2100 (AD 1943 - 2043)",
|
|
4
|
+
"2000": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
5
|
+
"2001": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
6
|
+
"2002": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
7
|
+
"2003": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
8
|
+
"2004": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
9
|
+
"2005": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
10
|
+
"2006": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
11
|
+
"2007": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
12
|
+
"2008": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
|
|
13
|
+
"2009": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
14
|
+
"2010": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
15
|
+
"2011": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
16
|
+
"2012": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
|
|
17
|
+
"2013": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
18
|
+
"2014": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
19
|
+
"2015": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
20
|
+
"2016": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
|
|
21
|
+
"2017": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
22
|
+
"2018": [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
23
|
+
"2019": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
24
|
+
"2020": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
25
|
+
"2021": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
26
|
+
"2022": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
|
|
27
|
+
"2023": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
28
|
+
"2024": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
29
|
+
"2025": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
30
|
+
"2026": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
31
|
+
"2027": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
32
|
+
"2028": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
33
|
+
"2029": [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
|
|
34
|
+
"2030": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
35
|
+
"2031": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
36
|
+
"2032": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
37
|
+
"2033": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
38
|
+
"2034": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
39
|
+
"2035": [30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
|
|
40
|
+
"2036": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
41
|
+
"2037": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
42
|
+
"2038": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
43
|
+
"2039": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
|
|
44
|
+
"2040": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
45
|
+
"2041": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
46
|
+
"2042": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
47
|
+
"2043": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
|
|
48
|
+
"2044": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
49
|
+
"2045": [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
50
|
+
"2046": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
51
|
+
"2047": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
52
|
+
"2048": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
53
|
+
"2049": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
|
|
54
|
+
"2050": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
55
|
+
"2051": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
56
|
+
"2052": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
57
|
+
"2053": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
|
|
58
|
+
"2054": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
59
|
+
"2055": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
60
|
+
"2056": [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
|
|
61
|
+
"2057": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
62
|
+
"2058": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
63
|
+
"2059": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
64
|
+
"2060": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
65
|
+
"2061": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
66
|
+
"2062": [30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31],
|
|
67
|
+
"2063": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
68
|
+
"2064": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
69
|
+
"2065": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
70
|
+
"2066": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
|
|
71
|
+
"2067": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
72
|
+
"2068": [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
73
|
+
"2069": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
74
|
+
"2070": [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
|
|
75
|
+
"2071": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
76
|
+
"2072": [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
77
|
+
"2073": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
|
|
78
|
+
"2074": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
79
|
+
"2075": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
80
|
+
"2076": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
|
|
81
|
+
"2077": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
|
|
82
|
+
"2078": [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
83
|
+
"2079": [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
84
|
+
"2080": [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
|
|
85
|
+
"2081": [31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
86
|
+
"2082": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
87
|
+
"2083": [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
88
|
+
"2084": [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
89
|
+
"2085": [31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30],
|
|
90
|
+
"2086": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
91
|
+
"2087": [31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
|
|
92
|
+
"2088": [30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30],
|
|
93
|
+
"2089": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
94
|
+
"2090": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
95
|
+
"2091": [31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
|
|
96
|
+
"2092": [30, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
97
|
+
"2093": [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
98
|
+
"2094": [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
99
|
+
"2095": [31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 30, 30],
|
|
100
|
+
"2096": [30, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
|
|
101
|
+
"2097": [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
|
|
102
|
+
"2098": [31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 30, 31],
|
|
103
|
+
"2099": [31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30],
|
|
104
|
+
"2100": [31, 32, 31, 32, 30, 31, 30, 29, 30, 29, 30, 30]
|
|
105
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"description": "Reference date pairs for validation and testing. These are verified BS-AD date pairs used to validate conversion accuracy. Each pair represents a known accurate conversion point. Sources: Official Nepal government publications, historical records and verified events, cross-referenced with multiple calendar systems.",
|
|
4
|
+
"referenceDates": [
|
|
5
|
+
{
|
|
6
|
+
"bs": { "year": 2001, "month": 1, "day": 1 },
|
|
7
|
+
"ad": { "year": 1944, "month": 4, "day": 13 }
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"bs": { "year": 2010, "month": 1, "day": 1 },
|
|
11
|
+
"ad": { "year": 1953, "month": 4, "day": 13 }
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"bs": { "year": 2015, "month": 1, "day": 1 },
|
|
15
|
+
"ad": { "year": 1958, "month": 4, "day": 13 }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"bs": { "year": 2025, "month": 1, "day": 1 },
|
|
19
|
+
"ad": { "year": 1968, "month": 4, "day": 13 }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"bs": { "year": 2035, "month": 1, "day": 1 },
|
|
23
|
+
"ad": { "year": 1978, "month": 4, "day": 14 }
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"bs": { "year": 2045, "month": 1, "day": 1 },
|
|
27
|
+
"ad": { "year": 1988, "month": 4, "day": 13 }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"bs": { "year": 2055, "month": 1, "day": 1 },
|
|
31
|
+
"ad": { "year": 1998, "month": 4, "day": 14 }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"bs": { "year": 2065, "month": 1, "day": 1 },
|
|
35
|
+
"ad": { "year": 2008, "month": 4, "day": 13 }
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"bs": { "year": 2075, "month": 1, "day": 1 },
|
|
39
|
+
"ad": { "year": 2018, "month": 4, "day": 14 }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"bs": { "year": 2082, "month": 1, "day": 1 },
|
|
43
|
+
"ad": { "year": 2025, "month": 4, "day": 14 }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"bs": { "year": 2083, "month": 1, "day": 1 },
|
|
47
|
+
"ad": { "year": 2026, "month": 4, "day": 14 }
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|