1 |
- {"version":3,"sources":["../../../../src/components/VDatePicker/util/monthChange.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAP,MAAgB,OAAhB;AAEA;;;;AAIA,gBAAe,UAAC,KAAD,EAAgB,IAAhB,EAAgC;AAAA,2BACvB,MAAM,KAAN,CAAY,GAAZ,EAAiB,GAAjB,CAAqB,MAArB,CADuB;AAAA;AAAA,QACtC,IADsC;AAAA,QAChC,KADgC;;AAG7C,QAAI,QAAQ,IAAR,KAAiB,CAArB,EAAwB;AACtB,eAAU,OAAO,CAAjB;AACD,KAFD,MAEO,IAAI,QAAQ,IAAR,KAAiB,EAArB,EAAyB;AAC9B,eAAU,OAAO,CAAjB;AACD,KAFM,MAEA;AACL,eAAU,IAAV,SAAkB,IAAI,QAAQ,IAAZ,CAAlB;AACD;AACF,CAVD","sourcesContent":["import pad from './pad'\n\n/**\n * @param {String} value YYYY-MM format\n * @param {Number} sign -1 or +1\n */\nexport default (value: string, sign: number) => {\n const [year, month] = value.split('-').map(Number)\n\n if (month + sign === 0) {\n return `${year - 1}-12`\n } else if (month + sign === 13) {\n return `${year + 1}-01`\n } else {\n return `${year}-${pad(month + sign)}`\n }\n}\n"],"sourceRoot":""}
|