https://github.com/datetime/weekday
Get the name and number of the current weekday. Or get the name of the weekday for a given number
https://github.com/datetime/weekday
Last synced: 8 months ago
JSON representation
Get the name and number of the current weekday. Or get the name of the weekday for a given number
- Host: GitHub
- URL: https://github.com/datetime/weekday
- Owner: datetime
- License: mit
- Created: 2014-04-21T10:39:35.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-01T00:35:31.000Z (over 9 years ago)
- Last Synced: 2025-04-12T09:51:50.115Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/datetime
- Size: 14.6 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# weekday [](https://www.npmjs.com/package/weekday) [](https://npmjs.org/package/weekday) [](https://travis-ci.org/datetime/weekday)
> Get the name and number of the current weekday. Or get the name of the weekday for a given number.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save weekday
```
## Usage
```js
var weekday = require('weekday');
weekday();
//=> 'Sunday' (current day)
weekday('Sunday');
//=> '1'
weekday(1);
//=> 'Sunday'
weekday(4);
//=> 'Wednesday'
```
## About
### Related projects
* [time-diff](https://www.npmjs.com/package/time-diff): Returns the formatted, high-resolution time difference between `start` and `end` times. | [homepage](https://github.com/jonschlinkert/time-diff "Returns the formatted, high-resolution time difference between `start` and `end` times.")
* [time-stamp](https://www.npmjs.com/package/time-stamp): Get a formatted timestamp. | [homepage](https://github.com/jonschlinkert/time-stamp "Get a formatted timestamp.")
* [week](https://www.npmjs.com/package/week): Get the current week number. | [homepage](https://github.com/jonschlinkert/week "Get the current week number.")
* [year](https://www.npmjs.com/package/year): Simple utility to get the current year with 2 or 4 digits. | [homepage](https://github.com/jonschlinkert/year "Simple utility to get the current year with 2 or 4 digits.")
### Contributors
| **Commits** | **Contributor**
|
| --- | --- |
| 12 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [brentvatne](https://github.com/brentvatne) |
| 1 | [davidohlin](https://github.com/davidohlin) |
### Building docs
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install -g verb verb-generate-readme && verb
```
### Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
### License
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/datetime/weekday/blob/master/LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on September 19, 2016._