1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 22:33:17 +00:00
musix-oss/node_modules/date-and-time/plugin/two-digit-year.js

31 lines
920 B
JavaScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
(function (global) {
'use strict';
var exec = function (date) {
date.plugin('two-digit-year', {
parser: {
YY: function (str) {
var result = this.exec(/^\d\d/, str);
result.value += result.value < 70 ? 2000 : 1900;
return result;
},
Y: function (str) {
var result = this.exec(/^\d\d?/, str);
result.value += result.value < 70 ? 2000 : 1900;
return result;
}
}
});
};
if (typeof module === 'object' && typeof module.exports === 'object') {
(module.paths || []).push('./');
exec(require('date-and-time'));
} else if (typeof define === 'function' && define.amd) {
define(['date-and-time'], exec);
} else {
exec(global.date);
}
}(this));