mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 12:32:32 -05:00
8e0aa685ce
[web] All versions of history entries GitOrigin-RevId: 7365ac4913c115b3b2872a3713d893463719c15e
20 lines
421 B
JavaScript
20 lines
421 B
JavaScript
import moment from 'moment'
|
|
|
|
moment.updateLocale('en', {
|
|
calendar: {
|
|
lastDay: '[Yesterday]',
|
|
sameDay: '[Today]',
|
|
nextDay: '[Tomorrow]',
|
|
lastWeek: 'ddd, Do MMM YY',
|
|
nextWeek: 'ddd, Do MMM YY',
|
|
sameElse: 'ddd, Do MMM YY',
|
|
},
|
|
})
|
|
|
|
export function formatTime(date, format = 'h:mm a') {
|
|
return moment(date).format(format)
|
|
}
|
|
|
|
export function relativeDate(date) {
|
|
return moment(date).calendar()
|
|
}
|