index.js 295 B

123456789101112131415
  1. export default (function (o, c) {
  2. var proto = c.prototype;
  3. proto.isoWeeksInYear = function () {
  4. var isLeapYear = this.isLeapYear();
  5. var last = this.endOf('y');
  6. var day = last.day();
  7. if (day === 4 || isLeapYear && day === 5) {
  8. return 53;
  9. }
  10. return 52;
  11. };
  12. });