File tree 5 files changed +14
-14
lines changed
5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
- let moment = require ( 'moment ' ) ;
1
+ let { DateTime } = require ( 'luxon ' ) ;
2
2
let CoreObject = require ( 'core-object' ) ;
3
3
4
4
module . exports = CoreObject . extend ( {
@@ -38,7 +38,7 @@ module.exports = CoreObject.extend({
38
38
let value = revision [ key . name ] ? revision [ key . name ] : "" ;
39
39
40
40
if ( key . name === 'timestamp' ) {
41
- value = moment ( value ) . format ( "YYYY /MM/DD HH:mm:ss") ;
41
+ value = DateTime . fromMillis ( value ) . toFormat ( "yyyy /MM/dd HH:mm:ss") ;
42
42
}
43
43
44
44
if ( key . maxLength !== - 1 ) {
Original file line number Diff line number Diff line change 1
1
const Table = require ( 'cli-table3' ) ;
2
- const moment = require ( 'moment ' ) ;
2
+ const { DateTime } = require ( 'luxon ' ) ;
3
3
const CoreObject = require ( 'core-object' ) ;
4
4
const RSVP = require ( 'rsvp' ) ;
5
5
@@ -70,7 +70,7 @@ module.exports = CoreObject.extend({
70
70
] ;
71
71
72
72
if ( this . _isWide ( ) ) {
73
- let value = moment ( data . timestamp ) . format ( "YYYY /MM/DD HH:mm:ss" ) ;
73
+ let value = DateTime . fromMillis ( data . timestamp ) . toFormat ( 'yyyy /MM/dd HH:mm:ss' ) ;
74
74
row . push ( value ) ;
75
75
}
76
76
Original file line number Diff line number Diff line change 21
21
"cli-table3" : " ^0.6.0" ,
22
22
"core-object" : " ^3.1.5" ,
23
23
"ember-cli-deploy-plugin" : " ^0.2.3" ,
24
- "moment " : " ^2 .25.3 " ,
24
+ "luxon " : " ^1 .25.0 " ,
25
25
"rsvp" : " ^4.8.5"
26
26
},
27
27
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const moment = require ( 'moment ' ) ;
3
+ const { DateTime } = require ( 'luxon ' ) ;
4
4
const chai = require ( 'chai' ) ;
5
5
const chaiAsPromised = require ( "chai-as-promised" ) ;
6
6
chai . use ( chaiAsPromised ) ;
@@ -198,10 +198,10 @@ describe('displayRevisions plugin', function() {
198
198
assert . equal ( messages . length , 0 ) ;
199
199
} ) ;
200
200
201
- it ( 'transforms timestamps to human-readable dates (YYYY /MM/DD HH:mm:ss)' , function ( ) {
201
+ it ( 'transforms timestamps to human-readable dates (yyyy /MM/dd HH:mm:ss)' , function ( ) {
202
202
plugin . displayRevisions ( context ) ;
203
- let expectedFormat = ( 'YYYY /MM/DD HH:mm:ss' ) ;
204
- let expectedDate = moment ( 1438232435000 ) . format ( expectedFormat ) ;
203
+ let expectedFormat = ( 'yyyy /MM/dd HH:mm:ss' ) ;
204
+ let expectedDate = DateTime . fromMillis ( 1438232435000 ) . toFormat ( expectedFormat ) ;
205
205
206
206
let messages = mockUi . messages . reduce ( function ( previous , current ) {
207
207
if ( current . indexOf ( expectedDate ) !== - 1 ) {
Original file line number Diff line number Diff line change @@ -4725,6 +4725,11 @@ lru-cache@^5.1.1:
4725
4725
dependencies :
4726
4726
yallist "^3.0.2"
4727
4727
4728
+ luxon@^1.25.0 :
4729
+ version "1.25.0"
4730
+ resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.25.0.tgz#d86219e90bc0102c0eb299d65b2f5e95efe1fe72"
4731
+ integrity sha512-hEgLurSH8kQRjY6i4YLey+mcKVAWXbDNlZRmM6AgWDJ1cY3atl8Ztf5wEY7VBReFbmGnwQPz7KYJblL8B2k0jQ==
4732
+
4728
4733
macos-release@^2.2.0 :
4729
4734
version "2.3.0"
4730
4735
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f"
@@ -5113,11 +5118,6 @@ mocha@^7.1.2:
5113
5118
yargs-parser "13.1.2"
5114
5119
yargs-unparser "1.6.0"
5115
5120
5116
- moment@^2.25.3 :
5117
- version "2.25.3"
5118
- resolved "https://registry.yarnpkg.com/moment/-/moment-2.25.3.tgz#252ff41319cf41e47761a1a88cab30edfe9808c0"
5119
- integrity sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==
5120
-
5121
5121
morgan@^1.9.1 :
5122
5122
version "1.10.0"
5123
5123
resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7"
You can’t perform that action at this time.
0 commit comments