File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,22 @@ In HTML
1616<script src =" ./your/own/path/holiday_jp.js" ></script >
1717<script >
1818var holidays = holiday_jp .between (new Date (' 2010-09-14' ), new Date (' 2010-09-21' ));
19- console .log (holidays[0 ][' name' ]) // // 敬老の日
19+ console .log (holidays[0 ][' name' ]); // 敬老の日
2020 </script >
2121```
2222
2323In Node
2424
2525``` javascript
26- var holiday_jp = require (' holiday_jp' );
26+ var holiday_jp = require (' @holiday-jp/ holiday_jp' );
2727var holidays = holiday_jp .between (new Date (' 2010-09-14' ), new Date (' 2010-09-21' ));
28- console .log (holidays[0 ][' name' ]) // // 敬老の日
28+ console .log (holidays[0 ][' name' ]); // 敬老の日
29+ ```
30+
31+ In TypeScript
32+
33+ ``` typescript
34+ import * as holiday_jp from ' @holiday-jp/holiday_jp' ;
35+ const holidays = holiday_jp .between (new Date (' 2010-09-14' ), new Date (' 2010-09-21' ));
36+ console .log (holidays [0 ][' name' ]); // 敬老の日
2937```
Original file line number Diff line number Diff line change 1+ /**
2+ * The type definition of a holiday
3+ * @see https://github.com/holiday-jp/holiday_jp-js/blob/master/lib/holidays.js
4+ */
5+ export interface Holiday {
6+ /**
7+ * Expression of Date object
8+ */
9+ date : Date ;
10+ /**
11+ * Day of the week in Japanese
12+ */
13+ week : string ;
14+ /**
15+ * Day of the week in English
16+ */
17+ week_en : string ;
18+ /**
19+ * Holiday name in Japanese
20+ */
21+ name : string ;
22+ /**
23+ * Holiday name in English
24+ */
25+ name_en : string ;
26+ }
27+
28+ /**
29+ * The version of this package
30+ */
31+ export const VERSION : string
32+
33+ /**
34+ * Find holidays between parameters
35+ * @param start Start date to find holiday
36+ * @param end End date to find holiday
37+ * @returns The holiday list between start and end, or empty if none
38+ */
39+ export function between ( start : Date , end : Date ) : Holiday [ ] ;
40+
41+ /**
42+ * Check if parameter is holiday
43+ * @param date A reference to be checked against holiday
44+ * @returns True if the provided reference is holiday otherwise false
45+ */
46+ export function isHoliday ( date : Date ) : boolean ;
Original file line number Diff line number Diff line change 33 "version" : " 2.2.2" ,
44 "description" : " Japanese holidays" ,
55 "main" : " release/holiday_jp.js" ,
6+ "types" : " lib/holiday_jp.d.ts" ,
67 "scripts" : {
78 "test" : " mocha --require should test/*.js" ,
89 "generate" : " git submodule update; cd holiday_jp/; git fetch origin master; git reset --hard origin/master; cd ../; node scripts/generate.js" ,
You can’t perform that action at this time.
0 commit comments