From 706b5d253f4603cf7aa1567c963285a6b50d7193 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Mon, 6 Nov 2017 15:49:04 +0900 Subject: [PATCH] Fix updated date at note list --- browser/components/NoteItem.styl | 2 +- browser/main/NoteList/index.js | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/browser/components/NoteItem.styl b/browser/components/NoteItem.styl index b156f5ae..542eb6e1 100644 --- a/browser/components/NoteItem.styl +++ b/browser/components/NoteItem.styl @@ -119,7 +119,7 @@ $control-height = 30px .item-bottom-time color $ui-inactive-text-color - font-size 11px + font-size 13px padding-left 2px padding-bottom 2px diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index c9e116d7..cfe8c4cb 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -488,6 +488,25 @@ class NoteList extends React.Component { if (note.isTrashed !== true || location.pathname === '/trashed') return true }) + moment.locale('en', { + relativeTime: { + future: 'in %s', + past: '%s ago', + s: '%ds', + ss: '%ss', + m: '1m', + mm: '%dm', + h: 'an hour', + hh: '%dh', + d: '1 d', + dd: '%dd', + M: 'a month', + MM: '%dM', + y: 'a year', + yy: '%dY' + } + }); + let noteList = notes .map(note => { if (note == null) { @@ -499,7 +518,7 @@ class NoteList extends React.Component { const dateDisplay = moment( config.sortBy === 'CREATED_AT' ? note.createdAt : note.updatedAt - ).fromNow() + ).fromNow('D') const key = `${note.storage}-${note.key}` if (isDefault) {