MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / clockString

Function clockString

lib/myfunc.js:81–86  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

79 return dDisplay + hDisplay + mDisplay + sDisplay;
80};
81export const clockString = (ms) => {
82 const h = isNaN(ms) ? '--' : Math.floor(ms / 3600000);
83 const m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60;
84 const s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60;
85 return [h, m, s].map(v => v.toString().padStart(2, '0')).join(':');
86};
87export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
88export const isUrl = (url) => url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi'));
89export const getTime = (format, date) => {

Callers 1

myfunc.test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected