Skip to content

Commit 9e23ac6

Browse files
authored
Merge pull request #41 from kpfefferle/luxon-fix
Fall back to ISO if timestamp is not milliseconds
2 parents 24cb600 + 9119c2e commit 9e23ac6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/legacy-table.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ module.exports = CoreObject.extend({
3838
let value = revision[key.name] ? revision[key.name] : "";
3939

4040
if(key.name === 'timestamp') {
41-
value = DateTime.fromMillis(value).toFormat("yyyy/MM/dd HH:mm:ss");
41+
// ember-cli-deploy-revision-data uses ISO timestamps, so fall back to ISO if not milliseconds
42+
let dt = typeof value === 'number' ? DateTime.fromMillis(value) : DateTime.fromISO(value);
43+
value = dt.toFormat("yyyy/MM/dd HH:mm:ss");
4244
}
4345

4446
if(key.maxLength !== -1) {

lib/scm-table.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ module.exports = CoreObject.extend({
7070
];
7171

7272
if (this._isWide()) {
73-
let value = DateTime.fromMillis(data.timestamp).toFormat('yyyy/MM/dd HH:mm:ss');
73+
let { timestamp } = data;
74+
// ember-cli-deploy-revision-data uses ISO timestamps, so fall back to ISO if not milliseconds
75+
let dt = typeof timestamp === 'number' ? DateTime.fromMillis(timestamp) : DateTime.fromISO(timestamp);
76+
let value = dt.toFormat('yyyy/MM/dd HH:mm:ss');
7477
row.push(value);
7578
}
7679

0 commit comments

Comments
 (0)