summaryrefslogtreecommitdiff
path: root/frontend/src/util/date-time.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-02 18:39:28 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:21 +0200
commitf119fc78dda4d1e828dde04f378a63a93e3a0a7e (patch)
treebea1eace5d47f21a7ccb835c6a6079bc92e48710 /frontend/src/util/date-time.js
parent7f27a6370a0af25e1bf6ff8f46360c6c26c21e0b (diff)
Add current progress on frontend port
Diffstat (limited to 'frontend/src/util/date-time.js')
-rw-r--r--frontend/src/util/date-time.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/frontend/src/util/date-time.js b/frontend/src/util/date-time.js
index d176ebef..66efdf5b 100644
--- a/frontend/src/util/date-time.js
+++ b/frontend/src/util/date-time.js
@@ -39,10 +39,7 @@ export function formatDateTime(dateTime) {
'/' +
addPaddingToTwo(dateTime.getFullYear())
- if (
- dateTime.getFullYear() === currentDate.getFullYear() &&
- dateTime.getMonth() === currentDate.getMonth()
- ) {
+ if (dateTime.getFullYear() === currentDate.getFullYear() && dateTime.getMonth() === currentDate.getMonth()) {
if (dateTime.getDate() === currentDate.getDate()) {
date = 'Today'
} else if (dateTime.getDate() === currentDate.getDate() - 1) {
@@ -50,13 +47,7 @@ export function formatDateTime(dateTime) {
}
}
- return (
- date +
- ', ' +
- addPaddingToTwo(dateTime.getHours()) +
- ':' +
- addPaddingToTwo(dateTime.getMinutes())
- )
+ return date + ', ' + addPaddingToTwo(dateTime.getHours()) + ':' + addPaddingToTwo(dateTime.getMinutes())
}
/**
@@ -83,9 +74,7 @@ export function convertSecondsToFormattedTime(seconds) {
} else if (hour === 0) {
return minute + 'm' + addPaddingToTwo(second) + 's'
} else {
- return (
- hour + 'h' + addPaddingToTwo(minute) + 'm' + addPaddingToTwo(second) + 's'
- )
+ return hour + 'h' + addPaddingToTwo(minute) + 'm' + addPaddingToTwo(second) + 's'
}
}