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
mbostock / weekday.js
Last active Jul 4, 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.