mirror of
https://github.com/Lissy93/happy-app.git
synced 2021-05-12 19:52:18 +03:00
Will store common helper functions
This commit is contained in:
12
server/commons/helpers.js
Normal file
12
server/commons/helpers.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
class Helpers {
|
||||
|
||||
static roundDate(timeStamp){
|
||||
timeStamp -= timeStamp % (24 * 60 * 60 * 1000);// Minus time since midnight
|
||||
timeStamp += new Date().getTimezoneOffset() * 60 * 1000;// Add timezone offset
|
||||
return new Date(timeStamp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Helpers;
|
||||
Reference in New Issue
Block a user