1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00
Files
Boostnote/browser/lib/date-formatter.js
2017-01-03 16:15:45 +09:00

19 lines
364 B
JavaScript

/**
* @fileoverview Formatting date string.
*/
import moment from 'moment';
/**
* @description Return date string. For example, 'Sep.9, 2016 12:00'.
* @param {mixed}
* @return {string}
*/
export function getLastUpdated(date) {
const m = moment(date)
if (!m.isValid()) {
throw Error('Invalid argument.');
}
return m.format('MMM D, gggg H:mm')
}