Skip to content

Commit

Permalink
fix: dates for form items
Browse files Browse the repository at this point in the history
  • Loading branch information
arfamomin committed Apr 14, 2024
1 parent 1c58e40 commit 0237b77
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions src/app/(BottomTabNavigation)/AllCases/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,23 @@ export async function fetchAllCases(userUid: UserUid): Promise<Case[]> {
* @returns readable date string
*/
export function formatDate(dateObject: Date) {
const date = new Date(dateObject).toDateString().split(' ');
return `${date[1]} ${date[2]}, ${date[3]}`;
const date = new Date(dateObject);
const months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];
const monthName = months[date.getUTCMonth()];
return `${monthName} ${date.getUTCDate()}, ${date.getUTCFullYear()}`;
}

export function getStatusColor(status: string) {
Expand Down

0 comments on commit 0237b77

Please sign in to comment.