Update 24 hour times to have zeros in front of single digit numbers

Previously, the gr-date-formatter formatted 24 hour times as H:MM
so times less than 10am had a single digit before the colon. This
change updates the time format to HH:mm so that all single digit
numbers have a zero in front of them.

Bug: Issue 4656
Change-Id: Ic91f95987ac50528cfb4955809ac8d08e915308d
This commit is contained in:
Becky Siegel
2016-09-28 15:18:40 -07:00
parent 5e4491886b
commit 8b38727f0b
2 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@
var TimeFormats = {
TIME_12: 'h:mm A', // 2:14 PM
TIME_24: 'H:mm', // 14:14
TIME_24: 'HH:mm', // 14:14
MONTH_DAY: 'MMM DD', // Aug 29
MONTH_DAY_YEAR: 'MMM DD, YYYY', // Aug 29, 1997
};

View File

@@ -98,13 +98,13 @@ limitations under the License.
test('More than 24 hours but less than six months', function(done) {
testDates('2015-07-29 20:34:14.985000000',
'2015-06-15 03:25:14.985000000',
'Jun 15', 'Jun 15, 2015, 3:25', done);
'Jun 15', 'Jun 15, 2015, 03:25', done);
});
test('More than six months', function(done) {
testDates('2015-09-15 20:34:00.000000000',
'2015-01-15 03:25:00.000000000',
'Jan 15, 2015', 'Jan 15, 2015, 3:25', done);
'Jan 15, 2015', 'Jan 15, 2015, 03:25', done);
});
});
@@ -174,7 +174,7 @@ limitations under the License.
});
test('Default preferences are respected', function() {
assert.equal(element._timeFormat, 'H:mm');
assert.equal(element._timeFormat, 'HH:mm');
assert.isFalse(element._relative);
});
});