feat(SPA): users page and invite modal
This commit is contained in:
1 parent
acdef18b37
commit
6afffc1984
20 files changed
+1880
-55
No files matched your search
@@ -47,3 +47,16 @@ export function formatRelativeDate(iso: string, now: Date = new Date()) {
|
||||
}
|
||||
return formatAbsoluteDate(date)
|
||||
}
|
||||
|
||||
function isSameLocalDay(a: Date, b: Date) {
|
||||
return (
|
||||
a.getFullYear() === b.getFullYear() &&
|
||||
a.getMonth() === b.getMonth() &&
|
||||
a.getDate() === b.getDate()
|
||||
)
|
||||
}
|
||||
|
||||
export function formatCreatedDate(iso: string, now: Date = new Date()) {
|
||||
const date = new Date(iso)
|
||||
return isSameLocalDay(date, now) ? 'Today' : formatAbsoluteDate(date)
|
||||
}
|
||||
Reference in new issue
Block a user