Skip to content

Commit

Permalink
fix: use dayjs for proper timestamp formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Jun 28, 2023
1 parent fd87314 commit c235b5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/WorkOrders/ListView/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import dayjs from "dayjs";
import Text from "@mui/material/Typography";
import {
CoreListItemLayout,
Expand All @@ -18,7 +19,7 @@ export const WorkOrdersListItem = ({
const { createdBy, assignedTo, status, location, description, createdAt } = item;
const userToDisplay = isInboxList ? createdBy : assignedTo;

const prettyCreatedAt = createdAt.toLocaleDateString("en-us", { day: "numeric", month: "short" });
const prettyCreatedAt = dayjs(createdAt).format("MMM D");
const prettyStatus = status.replace(/_/g, " ");

return (
Expand Down

0 comments on commit c235b5f

Please sign in to comment.