ABPCMS.Web/lib/moment/min/tests.js
(开头部分) 3.46MB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../../moment')) :
typeof define === 'function' && define.amd ? define(['../../moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
function each(array, callback) {
var i;
for (i = 0; i < array.length; i++) {
callback(array[i], i, array);
}
}
function objectKeys(obj) {
if (Object.keys) {
return Object.keys(obj);
} else {
// IE8
var res = [], i;
for (i in obj) {
if (obj.hasOwnProperty(i)) {
res.push(i);
}
}
return res;
}
}
// Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function defineCommonLocaleTests(locale, options) {
test('lenient ordinal parsing', function (assert) {
var i, ordinalStr, testMoment;
for (i = 1; i <= 31; ++i) {
ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
testMoment = moment(ordinalStr, 'YYYY MM Do');
assert.equal(testMoment.year(), 2014,
'lenient ordinal parsing ' + i + ' year check');
assert.equal(testMoment.month(), 0,
'lenient ordinal parsing ' + i + ' month check');
assert.equal(testMoment.date(), i,
'lenient ordinal parsing ' + i + ' date check');
}
});
test('lenient ordinal parsing of number', function (assert) {
var i, testMoment;
for (i = 1; i <= 31; ++i) {
testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
后面还有 5078+ 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
