aboutsummaryrefslogtreecommitdiff
path: root/node_modules/es5-ext/test/date/#
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/es5-ext/test/date/#
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/es5-ext/test/date/#')
-rw-r--r--node_modules/es5-ext/test/date/#/copy.js10
-rw-r--r--node_modules/es5-ext/test/date/#/days-in-month.js17
-rw-r--r--node_modules/es5-ext/test/date/#/floor-day.js6
-rw-r--r--node_modules/es5-ext/test/date/#/floor-month.js6
-rw-r--r--node_modules/es5-ext/test/date/#/floor-year.js6
-rw-r--r--node_modules/es5-ext/test/date/#/format.js6
6 files changed, 51 insertions, 0 deletions
diff --git a/node_modules/es5-ext/test/date/#/copy.js b/node_modules/es5-ext/test/date/#/copy.js
new file mode 100644
index 000000000..27c996bba
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/copy.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = new Date(), o2;
+
+ o2 = t.call(o);
+ a.not(o, o2, "Different objects");
+ a.ok(o2 instanceof Date, "Instance of Date");
+ a(o.getTime(), o2.getTime(), "Same time");
+};
diff --git a/node_modules/es5-ext/test/date/#/days-in-month.js b/node_modules/es5-ext/test/date/#/days-in-month.js
new file mode 100644
index 000000000..ce2dd7754
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/days-in-month.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2001, 0, 1)), 31, "January");
+ a(t.call(new Date(2001, 1, 1)), 28, "February");
+ a(t.call(new Date(2000, 1, 1)), 29, "February (leap)");
+ a(t.call(new Date(2001, 2, 1)), 31, "March");
+ a(t.call(new Date(2001, 3, 1)), 30, "April");
+ a(t.call(new Date(2001, 4, 1)), 31, "May");
+ a(t.call(new Date(2001, 5, 1)), 30, "June");
+ a(t.call(new Date(2001, 6, 1)), 31, "July");
+ a(t.call(new Date(2001, 7, 1)), 31, "August");
+ a(t.call(new Date(2001, 8, 1)), 30, "September");
+ a(t.call(new Date(2001, 9, 1)), 31, "October");
+ a(t.call(new Date(2001, 10, 1)), 30, "November");
+ a(t.call(new Date(2001, 11, 1)), 31, "December");
+};
diff --git a/node_modules/es5-ext/test/date/#/floor-day.js b/node_modules/es5-ext/test/date/#/floor-day.js
new file mode 100644
index 000000000..fa929d683
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/floor-day.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(),
+ new Date(2000, 0, 1).valueOf());
+};
diff --git a/node_modules/es5-ext/test/date/#/floor-month.js b/node_modules/es5-ext/test/date/#/floor-month.js
new file mode 100644
index 000000000..1df4ddbeb
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/floor-month.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(),
+ new Date(2000, 0, 1).valueOf());
+};
diff --git a/node_modules/es5-ext/test/date/#/floor-year.js b/node_modules/es5-ext/test/date/#/floor-year.js
new file mode 100644
index 000000000..5b78b7dcf
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/floor-year.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(),
+ new Date(2000, 0, 1).valueOf());
+};
diff --git a/node_modules/es5-ext/test/date/#/format.js b/node_modules/es5-ext/test/date/#/format.js
new file mode 100644
index 000000000..510b26b44
--- /dev/null
+++ b/node_modules/es5-ext/test/date/#/format.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var dt = new Date(2011, 2, 3, 3, 5, 5, 32);
+ a(t.call(dt, " %Y.%y.%m.%d.%H.%M.%S.%L "), " 2011.11.03.03.03.05.05.032 ");
+};