mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-04 04:42:37 +02:00
Mega UI revamp
This commit is contained in:
parent
650f481a96
commit
bcb686a20d
94 changed files with 6984 additions and 3889 deletions
19
apps/rowboat/lib/utils/date.ts
Normal file
19
apps/rowboat/lib/utils/date.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export function isToday(date: Date): boolean {
|
||||
const today = new Date();
|
||||
return date.getDate() === today.getDate() &&
|
||||
date.getMonth() === today.getMonth() &&
|
||||
date.getFullYear() === today.getFullYear();
|
||||
}
|
||||
|
||||
export function isThisWeek(date: Date): boolean {
|
||||
const now = new Date();
|
||||
const weekStart = new Date(now.getFullYear(), now.getMonth(), now.getDate() - now.getDay());
|
||||
const weekEnd = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()));
|
||||
return date >= weekStart && date <= weekEnd;
|
||||
}
|
||||
|
||||
export function isThisMonth(date: Date): boolean {
|
||||
const now = new Date();
|
||||
return date.getMonth() === now.getMonth() &&
|
||||
date.getFullYear() === now.getFullYear();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue