![]() ![]() Var data = calculator.NextHoliday(new Date( "1 January 2020")) Example var calendar = require( 'holidays-calendar-brazil') date if there's a holiday in the calendar anywhere after date false, otherwise. Date reference ( date won't be considered as a candidate). \\data equals to 'brazil' NextHoliday(date)ĭate: date, required. Verifies which locale/calendar the library is set to use. Var data = calculator.IsHoliday(new Date( "1 January 2020")) Verifies if date happens to be a holiday. Var data = calculator.IsBusinessDay(new Date( "1 January 2020")) Verifies if date doesn't correspond to a Sunday or Saturday, neither is a holiday. Var data = calculator.HolidaysBetween(new Date( "1 January 2020"), new Date( "31 December 2020")) Var calculator = require( 'business-days-calculator') Number of holidays according to the calendar in use. Var data = calculator.ContinuousDaysBetween(new Date( "1 January 2020"), new Date( "31 January 2020")) Ĭounts the number of holidays between date1 and date2 Example var calculator = require( 'business-days-calculator') API Reference ContinuousDaysBetween(date1, date2)Ĭounts the number of continuous/consecutive days between date1 and date2 Var calendar = require( "holidays-calendar-brazil") Ĭonsole.log( 'Today ' (calculator.IsBusinessDay(today) ? 'is' : 'isn\'t') ' a business day') Ĭonsole.log( 'Today ' (calculator.IsHoliday(today) ? 'is' : 'isn\'t') ' a holiday') Ĭonsole.log( 'The Carnival next year is due to ' (calculator.NextHoliday( new Date( "1 January " today.getFullYear())))) Ĭonsole.log( 'Today ' (BusinessDaysCalculator.IsBusinessDay(today) ? 'is' : 'isn\'t') ' a business day') Ĭonsole.log( 'Today ' (BusinessDaysCalculator.IsHoliday(today) ? 'is' : 'isn\'t') ' a holiday') Ĭonsole.log( 'The Carnival next year is due to ' (BusinessDaysCalculator.NextHoliday( new Date( "1 January " today.getFullYear())))) ![]() Usage Node.js var calculator = require( "business-days-calculator") ![]() Otherwise, you can download the latest release and use it in your browser or in other Javascript-based projects. If you use NPM, then you can install it with npm install business-days-calculator. You can use it as a Node.js module or in browser. This is a library for calculating the number of business days between two dates, considering the number of holidays in the range. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |