• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Japanese holiday.

holiday_jp JavaScript test

Get holidays in Japan.

Install

$ npm install @holiday-jp/holiday_jp

Usage

In HTML

<script src="./your/own/path/holiday_jp.js"></script>
<script>
var holidays = holiday_jp.between(new Date('2010-09-14'), new Date('2010-09-21'));
console.log(holidays[0]['name']); // ๆ•ฌ่€ใฎๆ—ฅ
</script>

In Node

var holiday_jp = require('@holiday-jp/holiday_jp');
var holidays = holiday_jp.between(new Date('2010-09-14'), new Date('2010-09-21'));
console.log(holidays[0]['name']); // ๆ•ฌ่€ใฎๆ—ฅ

If you want to use specific years only

var holiday_jp = require('@holiday-jp/holiday_jp/lib/no_autoload_holidays');
var holidays_2010 = require('@holiday-jp/holiday_jp/lib/holidays_every_year/2010');
var holidays_2011 = require('@holiday-jp/holiday_jp/lib/holidays_every_year/2011');
holiday_jp.setHolidays([holidays_2010, holidays_2011]);

var holidays = holiday_jp.between(new Date('2010-09-14'), new Date('2010-09-21'));
console.log(holidays[0]['name']); // ๆ•ฌ่€ใฎๆ—ฅ

In TypeScript

import * as holiday_jp from '@holiday-jp/holiday_jp';
const holidays = holiday_jp.between(new Date('2010-09-14'), new Date('2010-09-21'));
console.log(holidays[0]['name']); // ๆ•ฌ่€ใฎๆ—ฅ