negativeYear.js 570 B

1
  1. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_negativeYear=t()}(this,(function(){"use strict";return function(e,t,n){var i=t.prototype,o=function(e){var t=e.date,i=e.utc;if("string"==typeof t&&"-"===t.charAt(0)){var o=t.slice(1),r=n(o),f=(r=i?n.utc(o):n(o)).year();return-1!==t.indexOf("-"+f)?n(r).subtract(2*f,"year").toDate():t}return t},r=i.parse;i.parse=function(e){e.date=o.bind(this)(e),r.bind(this)(e)}}}));