moving front app to subfolder. add webpack config with watch and dev-server mode. moving deploy things in subfolder
This commit is contained in:
committed by
Daniel Hutzel
parent
0e86e1e1fd
commit
dbe4b8a7bd
28
media-store/util/helpers.js
Normal file
28
media-store/util/helpers.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const getDurationInMilliseconds = (start) => {
|
||||
const NS_PER_SEC = 1e9; // convert to nanoseconds
|
||||
const NS_TO_MS = 1e6; // convert to milliseconds
|
||||
const diff = process.hrtime(start);
|
||||
return (diff[0] * NS_PER_SEC + diff[1]) / NS_TO_MS;
|
||||
};
|
||||
|
||||
const getFormattedDateTime = () => {
|
||||
let currentDateTime = new Date();
|
||||
let formattedDateTime =
|
||||
currentDateTime.getFullYear() +
|
||||
"-" +
|
||||
(currentDateTime.getMonth() + 1) +
|
||||
"-" +
|
||||
currentDateTime.getDate() +
|
||||
" " +
|
||||
currentDateTime.getHours() +
|
||||
":" +
|
||||
currentDateTime.getMinutes() +
|
||||
":" +
|
||||
currentDateTime.getSeconds();
|
||||
return formattedDateTime;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getFormattedDateTime,
|
||||
getDurationInMilliseconds,
|
||||
};
|
||||
Reference in New Issue
Block a user