Skip to content

Instantly share code, notes, and snippets.

André Dumas andredumas

Block or report user

Report or block andredumas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mbostock / weekday.js
Last active Oct 23, 2019
Counting Weekdays
View weekday.js
weekday = (function() {
// Returns the weekday number for the given date relative to January 1, 1970.
function weekday(date) {
var weekdays = weekdayOfYear(date),
year = date.getFullYear();
while (--year >= 1970) weekdays += weekdaysInYear(year);
return weekdays;
You can’t perform that action at this time.