[new feature] add CountDown component (#3805)
This commit is contained in:
@@ -4,6 +4,12 @@ export function camelize(str: string): string {
|
||||
return str.replace(camelizeRE, (_, c) => c.toUpperCase());
|
||||
}
|
||||
|
||||
export function padZero(num: number | string): string {
|
||||
return (num < 10 ? '0' : '') + num;
|
||||
export function padZero(num: number | string, targetLength = 2): string {
|
||||
let str = num + '';
|
||||
|
||||
while (str.length < targetLength) {
|
||||
str = '0' + str;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user