You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
560 B

import { isNaN } from '../utils/validate/number';
export function times(n, iteratee) {
var index = -1;
var result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
export function getTrueValue(value) {
if (!value) {
return 0;
}
while (isNaN(parseInt(value, 10))) {
if (value.length > 1) {
value = value.slice(1);
} else {
return 0;
}
}
return parseInt(value, 10);
}
export function getMonthEndDay(year, month) {
return 32 - new Date(year, month - 1, 32).getDate();
}