Skip to content

Commit

Permalink
🚀 more code
Browse files Browse the repository at this point in the history
  • Loading branch information
shelcia committed Oct 21, 2022
1 parent 17257b2 commit c3496f0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/pages/admin/contacts/Contacts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useState } from "react";
import { CustomBasicHorizontalTable } from "../../../components/CustomBasicTable";
import CustomModal from "../../../components/CustomModal";
import CustomTable from "../../../components/CustomTable";
import { convertDateToDateWithoutTime } from "../../../utils/calendarHelpers";

const Contacts = () => {
const [index, setIndex] = useState(0);
Expand Down Expand Up @@ -117,9 +118,21 @@ const Contacts = () => {
title: "Company",
field: "company",
},
{ title: "Last Activity", field: "lastActivity" },
{
title: "Last Activity",
field: "lastActivity",
render: (rowDate) => (
<span>{convertDateToDateWithoutTime(rowDate.lastActivity)}</span>
),
},
{ title: "Lead Status", field: "leadStatus" },
{ title: "Created At", field: "createdAt" },
{
title: "Created At",
field: "createdAt",
render: (rowDate) => (
<span>{convertDateToDateWithoutTime(rowDate.createdAt)}</span>
),
},
{
field: "url",
title: "Actions",
Expand Down
7 changes: 7 additions & 0 deletions src/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ export const darkTheme = createTheme({
// color: "green",
// },
},
MuiMenu: {
styleOverrides: {
root: {
background: "#222a42",
},
},
},
},
});

Expand Down
22 changes: 22 additions & 0 deletions src/utils/calendarHelpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const convertDateToDateWithTime = (date) => {
const dates = new Date(date);
const formattedDate = Intl.DateTimeFormat("en-US", {
year: "numeric",
month: "short",
day: "2-digit",
hour: "numeric",
minute: "numeric",
second: "numeric",
}).format(dates);
return formattedDate;
};

export const convertDateToDateWithoutTime = (date) => {
const dates = new Date(date);
const formattedDate = Intl.DateTimeFormat("en-US", {
year: "numeric",
month: "short",
day: "2-digit",
}).format(dates);
return formattedDate;
};

1 comment on commit c3496f0

@vercel
Copy link

@vercel vercel bot commented on c3496f0 Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

easy-crm – ./

free-crm.vercel.app
easy-crm-git-master-shelcia.vercel.app
easy-crm-shelcia.vercel.app

Please sign in to comment.