first
This commit is contained in:
43
node_modules/vant/lib/datetime-picker/utils.js
generated
vendored
Normal file
43
node_modules/vant/lib/datetime-picker/utils.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.times = times;
|
||||
exports.getTrueValue = getTrueValue;
|
||||
exports.getMonthEndDay = getMonthEndDay;
|
||||
|
||||
var _number = require("../utils/validate/number");
|
||||
|
||||
function times(n, iteratee) {
|
||||
if (n < 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var index = -1;
|
||||
var result = Array(n);
|
||||
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function getTrueValue(value) {
|
||||
if (!value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((0, _number.isNaN)(parseInt(value, 10))) {
|
||||
if (value.length > 1) {
|
||||
value = value.slice(1);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return parseInt(value, 10);
|
||||
}
|
||||
|
||||
function getMonthEndDay(year, month) {
|
||||
return 32 - new Date(year, month - 1, 32).getDate();
|
||||
}
|
Reference in New Issue
Block a user