mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: widen formatDayOnly to accept string | number | Date
This commit is contained in:
@@ -57,7 +57,7 @@ export const OrganizationMemberCard = ({member, organization}: OrganizationMembe
|
|||||||
<div className="font-medium">{member.user.name}</div>
|
<div className="font-medium">{member.user.name}</div>
|
||||||
<div className="text-sm text-muted-foreground">{member.user.email}</div>
|
<div className="text-sm text-muted-foreground">{member.user.email}</div>
|
||||||
<div
|
<div
|
||||||
className="text-xs text-muted-foreground">Joined {formatDayOnly(new Date(member.createdAt))}</div>
|
className="text-xs text-muted-foreground">Joined {formatDayOnly(member.createdAt)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2 mt-4 md:mt-0">
|
<div className="flex items-center space-x-2 mt-4 md:mt-0">
|
||||||
|
|||||||
@@ -38,13 +38,14 @@ export function formatDateLastContact(lastContact: string | number | Date | null
|
|||||||
: "Never connected.";
|
: "Never connected.";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatDayOnly(date: Date) {
|
export function formatDayOnly(date: string | number | Date) {
|
||||||
|
const d = new Date(date);
|
||||||
return new Intl.DateTimeFormat("en-GB", {
|
return new Intl.DateTimeFormat("en-GB", {
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
month: "2-digit",
|
month: "2-digit",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
timeZone: TIMEZONE,
|
timeZone: TIMEZONE,
|
||||||
}).format(date);
|
}).format(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTodayISODate() {
|
export function getTodayISODate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user