mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
14 lines
271 B
JavaScript
14 lines
271 B
JavaScript
|
import moment from 'moment'
|
||
|
|
||
|
export function formatDate(date, format) {
|
||
|
if (!date) return 'N/A'
|
||
|
if (format == null) {
|
||
|
format = 'Do MMM YYYY, h:mm a'
|
||
|
}
|
||
|
return moment(date).format(format)
|
||
|
}
|
||
|
|
||
|
export function fromNowDate(date) {
|
||
|
return moment(date).fromNow()
|
||
|
}
|