code cleanup
This commit is contained in:
parent
09cf258a23
commit
a80f19aa60
@ -35,14 +35,11 @@ export const degToCompass = (num) => {
|
||||
return arr[val % 16];
|
||||
};
|
||||
|
||||
// unixToLocalTime
|
||||
// unixToLocalTime (23:31)
|
||||
export const unixToLocalTime = (unixSeconds, timezone) => {
|
||||
//convert time to 19:23 (last received data in 24h format)
|
||||
let time = new Date((unixSeconds + timezone) * 1000)
|
||||
.toISOString()
|
||||
.match(/(\d{2}:\d{2})/)[0];
|
||||
|
||||
// console.log(time);
|
||||
// time = time.startsWith("0") ? time.substring(1) : time;
|
||||
return time.startsWith("0") ? time.substring(1) : time;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user