jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
20 lines (15 loc) • 634 B
JavaScript
import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
import getUTCISOWeekYear from '../getUTCISOWeekYear/index.js';
// See issue: https://github.com/date-fns/date-fns/issues/376
function startOfUTCISOWeekYear(dirtyDate) {
if (arguments.length < 1) {
throw new TypeError('1 argument required, but only ' + arguments.length + ' present');
}
var year = getUTCISOWeekYear(dirtyDate);
var fourthOfJanuary = new Date(0);
fourthOfJanuary.setUTCFullYear(year, 0, 4);
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
var date = startOfUTCISOWeek(fourthOfJanuary);
return date;
}
export default startOfUTCISOWeekYear;