summaryrefslogtreecommitdiff
path: root/js_tests
diff options
context:
space:
mode:
authorGagan Deep <pandafy.dev@gmail.com>2020-10-25 07:32:57 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-28 11:11:37 +0100
commit982e860b736a4b1cc359e1fc90ce62d9b1ac7d0a (patch)
tree9a2e4a297057387a30c40beacfe98a3eacce43f6 /js_tests
parent0ee3cbd988a388e090ce1ddebb328c2201fa8cfc (diff)
Fixed #32062 -- Added %b support to Date.strftime.
This enables the admin to display the month as locale's abbreviated name if %b is used in the date format.
Diffstat (limited to 'js_tests')
-rw-r--r--js_tests/admin/core.test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/js_tests/admin/core.test.js b/js_tests/admin/core.test.js
index a74efc6d3c..ea780d01d0 100644
--- a/js_tests/admin/core.test.js
+++ b/js_tests/admin/core.test.js
@@ -40,6 +40,11 @@ QUnit.test('Date.getTwoDigitSecond', function(assert) {
assert.equal(new Date(2014, 6, 1, 0, 0, 20).getTwoDigitSecond(), '20', '12:00:20 am is 20');
});
+QUnit.test('Date.getAbbrevMonthName', function(assert) {
+ assert.equal(new Date(2020, 0, 26).getAbbrevMonthName(), 'Jan', 'jan 26');
+ assert.equal(new Date(2020, 9, 26).getAbbrevMonthName(), 'Oct', 'oct 26');
+});
+
QUnit.test('Date.getFullMonthName', function(assert) {
assert.equal(new Date(2020, 0, 26).getFullMonthName(), 'January', 'jan 26');
assert.equal(new Date(2020, 9, 26).getFullMonthName(), 'October', 'oct 26');
@@ -49,6 +54,7 @@ QUnit.test('Date.strftime', function(assert) {
const date = new Date(2014, 6, 1, 11, 0, 5);
assert.equal(date.strftime('%Y-%m-%d %H:%M:%S'), '2014-07-01 11:00:05');
assert.equal(date.strftime('%B %d, %Y'), 'July 01, 2014');
+ assert.equal(date.strftime('%b %d, %Y'), 'Jul 01, 2014');
});
QUnit.test('String.strptime', function(assert) {