MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / getFirstThursdayOfYear

Function getFirstThursdayOfYear

lib/test/angular/1.8.0/angular.js:22861–22867  ·  view source on GitHub ↗
(year)

Source from the content-addressed store, hash-verified

22859}
22860
22861function getFirstThursdayOfYear(year) {
22862 // 0 = index of January
22863 var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();
22864 // 4 = index of Thursday (+1 to account for 1st = 5)
22865 // 11 = index of *next* Thursday (+1 account for 1st = 12)
22866 return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);
22867}
22868
22869function getThursdayThisWeek(datetime) {
22870 return new Date(datetime.getFullYear(), datetime.getMonth(),

Callers 2

weekGetterFunction · 0.70
weekParserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected