moment-hk-business-days

1.0.0 • Public • Published

moment-hk-business-days

A Moment.js plugin based on moment-business-days that integrated with Hong Kong Public Holidays Data.

Installation

npm i moment-hk-business-days

Usage

const moment = require('moment-hk-business-days')();

API

getHolidays(options)

await moment.getHolidays(); 
// ['2020-01-01', '2020-01-25', '2020-01-27', ...]

await moment.getHolidays({withName: true, lang: 'tc', dateFormat: 'DD/MM/YYYY'}); 
// lang options: ['en', 'tc', 'sc']
// [{ date: '01/01/2020', name: '一月一日' }, { date: '25/01/2020', name: '農曆年初一' }, { date: '27/01/2020', name: '農曆年初三' }, ...]

initBusinessDays(options)

await moment.initBusinessDays();
// Configure business days with default settings 

await moment.initBusinessDays({locale: 'us', workingWeekdays: [1, 2, 3, 4, 5, 6]});

Package Sidebar

Install

npm i moment-hk-business-days

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

6.88 kB

Total Files

14

Last publish

Collaborators

  • gracesy1457