From 9e5ab2da2352908545de7221b01379d257cf66a9 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 20 Mar 2016 14:21:10 +0900 Subject: [PATCH] Judge 24 hours correctly --- src/components/time.js | 4 ++-- src/index.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/time.js b/src/components/time.js index 64be1a6..a3a2288 100644 --- a/src/components/time.js +++ b/src/components/time.js @@ -32,11 +32,11 @@ export default class Time extends React.Component { } getAbsoluteTime() { - return this.getMomentTime().format('YYYY-MM-DD HH:mm'); + return this.getMomentTime().format('YYYY/MM/DD'); } getDisplayedTime() { - if (this.getMomentTime().isBefore(moment.duration(24, 'hours'))) { + if (this.getMomentTime().isBefore(moment().subtract(1, 'day'))) { return this.getAbsoluteTime(); } else { return this.getRelativeTime(); diff --git a/src/index.scss b/src/index.scss index 74134e8..8811066 100644 --- a/src/index.scss +++ b/src/index.scss @@ -257,7 +257,7 @@ body { .name_wrapper { float: left; white-space: nowrap; - width: calc(100% - #{$icon_size + 40px}); + width: calc(100% - #{$icon_size + 10px}); overflow: hidden; text-overflow: ellipsis; color: $grey;