File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ module.exports = {
47
47
var value = revision [ key . name ] ? revision [ key . name ] : "" ;
48
48
49
49
if ( key . name === 'timestamp' ) {
50
- value = moment ( value ) . format ( "YYYY/MM/DD HH:MM:SS " ) ;
50
+ value = moment ( value ) . format ( "YYYY/MM/DD HH:mm:ss " ) ;
51
51
}
52
52
53
53
if ( key . maxLength !== - 1 ) {
Original file line number Diff line number Diff line change 1
1
/*jshint globalstrict: true*/
2
2
'use strict' ;
3
3
4
- var RSVP = require ( 'ember-cli/lib/ext/promise' ) ;
4
+ var RSVP = require ( 'ember-cli/lib/ext/promise' ) ;
5
+ var moment = require ( 'moment' ) ;
5
6
6
- var assert = require ( 'ember-cli/tests/helpers/assert' ) ;
7
+ var assert = require ( 'ember-cli/tests/helpers/assert' ) ;
7
8
8
9
describe ( 'displayRevisions plugin' , function ( ) {
9
10
var subject , mockUi , config ;
@@ -148,10 +149,14 @@ describe('displayRevisions plugin', function() {
148
149
assert . equal ( messages . length , 0 ) ;
149
150
} ) ;
150
151
151
- it ( 'transforms timestamps to human-readable dates' , function ( ) {
152
+ it ( 'transforms timestamps to human-readable dates (YYYY/MM/DD HH:mm:ss) ' , function ( ) {
152
153
plugin . displayRevisions ( context ) ;
154
+ var utcOffset = moment ( ) . utcOffset ( ) ;
155
+ var expectedFormat = ( 'YYYY/MM/DD HH:mm:ss' ) ;
156
+ var expectedDate = moment ( 1438232435000 ) . utcOffset ( utcOffset ) . format ( expectedFormat ) ;
157
+
153
158
var messages = mockUi . messages . reduce ( function ( previous , current ) {
154
- if ( current . indexOf ( "2015/07" ) !== - 1 ) {
159
+ if ( current . indexOf ( expectedDate ) !== - 1 ) {
155
160
previous . push ( current ) ;
156
161
}
157
162
You can’t perform that action at this time.
0 commit comments