const dayofweek = require('dayofweek');// API// dayofweek(year, month, day[, translate = true])// Invariants as per Tomohiko Sakamoto's original implementation.// * year > 1752// * 1 <= month <= 12// * 1 <= day <= 31// By default returns days of the week.dayofweek(2017, 6, 16);dayofweek(2017, 6, 16, true);dayofweek(2017, 6, 16, 'long');// → Friday// Setting translate = 'short' will return shorthand form of the days of the week.dayofweek(2017, 6,
License
Public Domain.
16
,
'short'
);
// → Fri
// Setting translate = false will return an integer representation of the day of the week.
// i.e. 0=Sun, 1=Mon, ..., 6=Sat
dayofweek(2017, 6, 16, false);
// → 5
// You can pass a translate function. This function will be given the integer
// representation of the day of the week. See above.