Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function formatUTCWeekNumberISO(d, p) {
var day = d.getUTCDay();
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
}
return function(date) {
var d = +date;
return (d3_time.utcSecond(date) < d ? formatMillisecond
: d3_time.utcMinute(date) < d ? formatSecond
: d3_time.utcHour(date) < d ? formatMinute
: d3_time.utcDay(date) < d ? formatHour
: d3_time.utcMonth(date) < d ?
(d3_time.utcWeek(date) < d ? formatDay : formatWeek)
: d3_time.utcYear(date) < d ? formatMonth
: formatYear)(date);
};
}
function formatUTCWeekNumberSunday(d, p) {
return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
}
function formatUTCDayOfYear(d, p) {
return pad(1 + utcDay.count(utcYear(d), d), p, 3);
}
function formatUTCWeekNumberMonday(d, p) {
return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
}