line_push/node_modules/vuetify/lib/components/VDatePicker/util/monthChange.js
2022-07-17 13:16:16 +08:00

18 lines
420 B
JavaScript

import pad from './pad';
/**
* @param {String} value YYYY-MM format
* @param {Number} sign -1 or +1
*/
export default ((value, sign) => {
const [year, month] = value.split('-').map(Number);
if (month + sign === 0) {
return `${year - 1}-12`;
} else if (month + sign === 13) {
return `${year + 1}-01`;
} else {
return `${year}-${pad(month + sign)}`;
}
});
//# sourceMappingURL=monthChange.js.map