Skip to content

Commit

Permalink
Improve date formatting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek committed Nov 25, 2024
1 parent a055fc3 commit 4df18a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/json/relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default {
'restrictions',
'source',
'lastModifiedDate',
'lastOpenedDate'
'lastOpenedDate',
'timestamp'
],

relation: [
Expand Down
8 changes: 1 addition & 7 deletions src/ts/lib/util/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,13 +795,7 @@ class UtilData {
S.Record.metaSet(subId, '', { total: message.counters.total, keys });
};

const mapper = it => {
if (it.id.startsWith('_date_')) {
const timestamp = U.Date.parseDate( it.id.substr(6, 17).replace(/-/g, '.'), I.DateFormat.ISO );
return ({ id: it[idField], details: {...it, name: U.Date.dateWithFormat(S.Common.dateFormat, timestamp)} });
}
return ({ id: it[idField], details: it });
};
const mapper = it => ({ id: it[idField], details: it });

let details = [];
if (message.dependencies && message.dependencies.length) {
Expand Down

0 comments on commit 4df18a5

Please sign in to comment.