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/pad.js

20 lines
542 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
const padStart = (string, targetLength, padString) => {
targetLength = targetLength >> 0;
string = String(string);
padString = String(padString);
if (string.length > targetLength) {
return String(string);
}
targetLength = targetLength - string.length;
if (targetLength > padString.length) {
padString += padString.repeat(targetLength / padString.length);
}
return padString.slice(0, targetLength) + String(string);
};
export default ((n, length = 2) => padStart(n, length, '0'));
//# sourceMappingURL=pad.js.map