From a202a716c44b39e8f92c632855b87cd61a9f782c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 16 Apr 2017 15:11:09 +0300 Subject: [PATCH] util time transform leading zero fix --- react/src/util/time.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/src/util/time.js b/react/src/util/time.js index f1a8cf8..80e7ec5 100644 --- a/react/src/util/time.js +++ b/react/src/util/time.js @@ -17,8 +17,8 @@ export function secondsToString(seconds) { year = a.getFullYear(), month = months[a.getMonth()], date = a.getDate(), - hour = a.getHours(), - min = a.getMinutes(), + hour = a.getHours() < 10 ? '0' + a.getHours() : a.getHours(), + min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes(), sec = a.getSeconds(), time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;