fix: ui improvement (#395)

* fix: current cycle date updation

* fix: sidebar overflow fix , date helper fn added
This commit is contained in:
Anmol Singh Bhatia 2023-03-07 22:38:49 +05:30 committed by GitHub
parent 30a91a6b91
commit afe2b029c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 41 deletions

View file

@ -125,3 +125,23 @@ export const renderShortDateWithYearFormat = (date: Date) => {
const year = date.getFullYear();
return isNaN(date.getTime()) ? "N/A" : ` ${month} ${day}, ${year}`;
};
export const renderShortDate = (date: Date) => {
const months = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
];
const day = date.getDate();
const month = months[date.getMonth()];
return isNaN(date.getTime()) ? "N/A" : `${day} ${month}`;
};