Refactored backend

This commit is contained in:
Senad Uka
2019-03-25 05:16:58 +01:00
parent 0d7c154958
commit 8c7f26b099
14 changed files with 5 additions and 72 deletions

13
app/lib/convertToDate.js Normal file
View File

@@ -0,0 +1,13 @@
function convertToDate(date) {
const [dan, mjesec, godina] = date
.split(". u ")[0]
.split(".")
.map(el => Number(el));
const [sati, minute] = date
.split(". u ")[1]
.split(":")
.map(el => Number(el));
return new Date(godina, mjesec, dan, sati, minute);
}
module.exports = convertToDate;