IsoWeeksInYear
IsoWeeksInYear ajoute l'API .isoWeeksInYear()
pour renvoyer un number
représentant le nombre de semaines dans l'année ISO.
TIP
Cette fonctionnalité nécessite le plugin IsLeapYear pour fonctionner.
javascript
var isoWeeksInYear = require('dayjs/plugin/isoWeeksInYear');
// import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' // ES 2015
var isLeapYear = require('dayjs/plugin/isLeapYear'); // Dépend du plugin IsLeapYear
// import isLeapYear from 'dayjs/plugin/isLeapYear' // ES 2015
dayjs.extend(isoWeeksInYear);
dayjs.extend(isLeapYear);
dayjs('2004-01-01').isoWeeksInYear(); // 53
dayjs('2005-01-01').isoWeeksInYear(); // 52