open-nomad/ui/app/helpers/format-ts.js
Phil Renaud a28e1bcc1e
[ui] Service Healthchecks: styles for pseudo-timestamp axis (#14677)
* Styles for pseudo-timestamp axis

* Changelog
2022-09-23 16:53:28 -04:00

14 lines
324 B
JavaScript

import moment from 'moment';
import Helper from '@ember/component/helper';
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);