🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

day-of-week

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

day-of-week

Returns an number 0-6 of the day of the week from a date. Is timezone aware.

1.0.4
latest
Source
npm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

NPM version Build Status Dependency Status

Returns an number 0-6 of the day of the week from a date. Is timezone aware.

Table of Contents generated with DocToc

Install

npm i -S day-of-week

Usage

var dayOfWeek = require('day-of-week').get

dayOfWeek(new Date(2015, 1, 1), 'America/Los_Angeles')
// 4

Methods

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

Returns the day of the week for the passed date. 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 determining the day of the week.

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

Keywords

day-of-week

FAQs

Package last updated on 28 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts