Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 360B

12345678910111213141516171819
  1. export default (function (o, c) {
  2. var proto = c.prototype;
  3. proto.weekYear = function () {
  4. var month = this.month();
  5. var weekOfYear = this.week();
  6. var year = this.year();
  7. if (weekOfYear === 1 && month === 11) {
  8. return year + 1;
  9. }
  10. if (month === 0 && weekOfYear >= 52) {
  11. return year - 1;
  12. }
  13. return year;
  14. };
  15. });