overleaf/services/web/frontend/js/utils/dates.js
Alexandre Bourdin a0fabee3b4 Merge pull request #9245 from overleaf/integration-project-dashboard-react-migration
[Integration branch] Project Dashboard React Migration

GitOrigin-RevId: 3c3db39109a8137c57995f5f7c0ff8c800f04c4e
2022-09-14 08:04:03 +00:00

13 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()
}