From 8ebdb94d3a588074fdcf5a43bb9bf8da62fd8e08 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sun, 28 Jan 2018 23:23:55 +0200 Subject: [PATCH] add some format for time string --- web/app/components/comment/comment.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index e4225829..5091ffe4 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -53,9 +53,10 @@ export default class Comment extends Component { const time = new Date(data.time); // TODO: which format for datetime should we choose? - // TODO: add smth that will count 'hours ago' - // TODO: check out stash's impl - const timeStr = `${time.toLocaleDateString()} ${time.toLocaleTimeString()}`; + // TODO: add smth that will count 'hours ago' (mb this: https://github.com/catamphetamine/javascript-time-ago) + // TODO: check out stash's impl; + // TODO: don't forget about optional locales, m? + const timeStr = `${time.toLocaleDateString([], { month: 'short', day: 'numeric' })}, ${time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`; const o = { ...data, time: timeStr,