is-business-day

1.0.1 • Public • Published

is-business-day NPM version Build Status Dependency Status

Pass a date, get back a boolean. Is timezone aware.

Table of Contents generated with DocToc

Install

npm i -S is-business-day

Usage

var isBusinessDay = require('is-business-day').get
 
isBusinessDay(new Date(2015, 1, 1), 'America/Los_Angeles')

Methods

get (<Date> date[, <String> sourceTimezone[, <String> destinationTimezone]])

Returns true if the passed date is a business day. If a timezone is passed as the second argument, it will ensure that the date is interpreted in that timezone.

Arguments

  • date String or unixTime or Date required.
  • sourceTimezone String: the timezone that the date is in. Must be passed in Olson TZID timezone format. e.g. America/Los_Angeles
  • destinationTimezone String: if the source timezone is passed, the destination timezone will convert from the source timezone to the destination timezone before processing.

Tests

Tests are prova, based on tape. They can be run with npm test.

Tests can be run in a loop with npm run tdd

Developing

To publish, run npm run release -- [{patch,minor,major}]

NOTE: you might need to sudo ln -s /usr/local/bin/node /usr/bin/node to ensure node is in your path for the git hooks to work

Requirements

  • npm > 2.0.0 So that passing args to a npm script will work. npm i -g npm
  • git > 1.8.3 So that git push --follow-tags will work. brew install git

License

Artistic 2.0 © Joey Baker

Package Sidebar

Install

npm i is-business-day

Weekly Downloads

0

Version

1.0.1

License

Artistic-2.0

Last publish

Collaborators

  • joeybaker