+ date utils
This commit is contained in:
1 parent
9b650da9be
commit
6acb7ba64d
2 files changed
+19
No files matched your search
@@ -50,6 +50,7 @@
|
||||
"koa-query": "0.0.2",
|
||||
"koa-route": "^3.1.0",
|
||||
"koa-static": "^3.0.0",
|
||||
"moment": "^2.18.1",
|
||||
"mongodb": "^2.1.14",
|
||||
"mz": "^2.4.0",
|
||||
"react": "^15.3.2",
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const moment = require('moment')
|
||||
moment.locale('ru')
|
||||
|
||||
/**
|
||||
*
|
||||
* Date -> DD.MM.YYYY
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
exports.dateFormat = date => moment(date).format('L')
|
||||
|
||||
/**
|
||||
*
|
||||
* Date -> Unix time
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
exports.timestamp = date => date.getTime()
|
||||
Reference in new issue
Block a user