Use luxon for DateTime

Signed-off-by: josh <josh.timmons@hashicorp.com>
This commit is contained in:
josh
2023-06-09 22:55:21 -04:00
parent 96c5c6f3fe
commit 7a995cf402
2 changed files with 10 additions and 2 deletions
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { DateTime } from 'luxon';
import {
Link,
MissingAnnotationEmptyState,
@@ -64,7 +65,10 @@ const columns: TableColumn<rowType>[] = [
{
title: 'Created',
field: 'CreateTime',
render: row => new Date(row.CreateTime / 1000000).toLocaleString(),
render: row =>
DateTime.fromMillis(row.CreateTime / 1000000).toLocaleString(
DateTime.DATETIME_MED_WITH_SECONDS,
),
},
{
title: 'Status',
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { DateTime } from 'luxon';
import {
InfoCard,
MissingAnnotationEmptyState,
@@ -49,7 +50,10 @@ const columns: TableColumn<rowType>[] = [
{
title: 'Submitted',
field: 'SubmitTime',
render: row => new Date(row.SubmitTime / 1000000).toLocaleString(),
render: row =>
DateTime.fromMillis(row.SubmitTime / 1000000).toLocaleString(
DateTime.DATETIME_MED_WITH_SECONDS,
),
},
];