1 line
1,007 B
Text
1 line
1,007 B
Text
|
{"version":3,"sources":["../../../../src/components/VDatePicker/util/monthChange.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,OAAhB;AAEA;;;;;AAIA,gBAAe,CAAC,KAAD,EAAgB,IAAhB,KAAgC;AAC7C,QAAM,CAAC,IAAD,EAAO,KAAP,IAAgB,KAAK,CAAC,KAAN,CAAY,GAAZ,EAAiB,GAAjB,CAAqB,MAArB,CAAtB;;AAEA,MAAI,KAAK,GAAG,IAAR,KAAiB,CAArB,EAAwB;AACtB,WAAO,GAAG,IAAI,GAAG,CAAC,KAAlB;AACD,GAFD,MAEO,IAAI,KAAK,GAAG,IAAR,KAAiB,EAArB,EAAyB;AAC9B,WAAO,GAAG,IAAI,GAAG,CAAC,KAAlB;AACD,GAFM,MAEA;AACL,WAAO,GAAG,IAAI,IAAI,GAAG,CAAC,KAAK,GAAG,IAAT,CAAc,EAAnC;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":"","file":"monthChange.js"}
|