open-nomad/ui/app/helpers/format-ts.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
324 B
JavaScript
Raw Normal View History

import moment from 'moment';
import Helper from '@ember/component/helper';
2020-05-04 19:22:10 +00:00
export function formatTs([date], options = {}) {
const format = options.short
? 'MMM D'
: options.timeOnly
? 'HH:mm:ss'
: "MMM DD, 'YY HH:mm:ss ZZ";
return moment(date).format(format);
}
export default Helper.helper(formatTs);