ArticleCard Date component refactoring + moved to separate file
This commit is contained in:
1 parent
9fb815081c
commit
0207f85f00
4 files changed
+37
-30
No files matched your search
@@ -1,18 +0,0 @@
|
||||
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()
|
||||
@@ -0,0 +1,18 @@
|
||||
import moment from 'moment'
|
||||
moment.locale('ru')
|
||||
|
||||
/**
|
||||
*
|
||||
* Date -> DD.MM.YYYY
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
export const dateFormat = (date: string) => moment(date).format('L')
|
||||
|
||||
/**
|
||||
*
|
||||
* Date -> Unix time
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
export const timestamp = (date: Date) => date.getTime()
|
||||
Reference in new issue
Block a user