added whole system from ola4doc

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-14 17:06:06 +01:00
parent 9646c74be1
commit 0611418f7a
8725 changed files with 817688 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
'use strict';
var getTime = Date.prototype.getTime;
module.exports = function () { return new Date(getTime.call(this)); };
+17
View File
@@ -0,0 +1,17 @@
'use strict';
var getMonth = Date.prototype.getMonth;
module.exports = function () {
switch (getMonth.call(this)) {
case 1:
return this.getFullYear() % 4 ? 28 : 29;
case 3:
case 5:
case 8:
case 10:
return 30;
default:
return 31;
}
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
var setHours = Date.prototype.setHours;
module.exports = function () {
setHours.call(this, 0, 0, 0, 0);
return this;
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
var floorDay = require('./floor-day');
module.exports = function () {
floorDay.call(this).setDate(1);
return this;
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
var floorMonth = require('./floor-month');
module.exports = function () {
floorMonth.call(this).setMonth(0);
return this;
};
+21
View File
@@ -0,0 +1,21 @@
'use strict';
var pad = require('../../number/#/pad')
, date = require('../valid-date')
, format;
format = require('../../string/format-method')({
Y: function () { return String(this.getFullYear()); },
y: function () { return String(this.getFullYear()).slice(-2); },
m: function () { return pad.call(this.getMonth() + 1, 2); },
d: function () { return pad.call(this.getDate(), 2); },
H: function () { return pad.call(this.getHours(), 2); },
M: function () { return pad.call(this.getMinutes(), 2); },
S: function () { return pad.call(this.getSeconds(), 2); },
L: function () { return pad.call(this.getMilliseconds(), 3); }
});
module.exports = function (pattern) {
return format.call(date(this), pattern);
};
+10
View File
@@ -0,0 +1,10 @@
'use strict';
module.exports = {
copy: require('./copy'),
daysInMonth: require('./days-in-month'),
floorDay: require('./floor-day'),
floorMonth: require('./floor-month'),
floorYear: require('./floor-year'),
format: require('./format')
};
+7
View File
@@ -0,0 +1,7 @@
'use strict';
module.exports = {
'#': require('./#'),
isDate: require('./is-date'),
validDate: require('./valid-date')
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
var toString = Object.prototype.toString
, id = toString.call(new Date());
module.exports = function (x) {
return (x && ((x instanceof Date) || (toString.call(x) === id))) || false;
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
var isDate = require('./is-date');
module.exports = function (x) {
if (!isDate(x) || isNaN(x)) throw new TypeError(x + " is not valid Date object");
return x;
};