Files
threshold-ui/addons/core/addon/helpers/format-date-iso.js
T

14 lines
343 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
2020-09-18 12:54:31 -04:00
import { helper } from '@ember/component/helper';
2020-11-18 12:23:26 -05:00
/**
* Takes a `Date` instance and returns a string formatted in ISO,
* e.g. "2020-01-01T00:00:00.999Z".
*/
2020-11-16 15:08:59 -05:00
export default helper(function formatDateIso(params /*, hash*/) {
2020-09-18 12:54:31 -04:00
return params[0].toISOString();
});