Pad time with zeros when saving temperature too

This commit is contained in:
Julia Friesel committed 2018-11-02 16:05:59 +01:00
1 parent 472edacb92
commit 4aecf69779
3 files changed
+15 -12

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
export default function (jsDate) {
const vals = [jsDate.getHours(), jsDate.getMinutes()]
return vals.map(val => {
if (parseInt(val) < 10) {
val = `0${val}`
}
return val
}).join(':')
}