This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VDatePicker/util/monthChange.js

18 lines
420 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
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