dayofweek
Get the day of the week given year, month, and day.
Port of dayofweek function given by Tomohiko Sakamoto on the comp.lang.c Usenet newsgroup
into JavaScript.
See: https://groups.google.com/forum/#!msg/comp.lang.c/m4YG7Uw72Ic/WQj-pRNzJaIJ
How it works: https://www.quora.com/How-does-Tomohiko-Sakamotos-Algorithm-work
Install
$ yarn add dayofweek
$ npm install dayofweek
$ npm install --save dayofweek
Usage
const dayofweek = require('dayofweek');
dayofweek(2017, 6, 16);
dayofweek(2017, 6, 16, true);
dayofweek(2017, 6, 16, 'long');
dayofweek(2017, 6, 16, 'short');
dayofweek(2017, 6, 16, false);
dayofweek(2017, 6, 16,
day_index =>
[
"lunes",
"martes",
"miércoles",
"jueves",
"viernes",
"sábado",
"domingo"
][day_index]
);
dayofweek(2017, 6, 16,
["lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"]
);
License
Public Domain.