Add website annotations with chart markers and CRUD management

This commit is contained in:
Mike Cao committed 2026-08-27 00:09:03 -07:00
1 parent eea124bbf8
commit 64e4cc1c3b
24 files changed
+957 -3

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import { endOfDay, endOfHour, startOfDay, startOfHour } from 'date-fns';
/**
* Returns the `date` URL parameter value that filters the website view
* to the day (all-day annotation) or hour (timed annotation) of an annotation.
*/
export function getAnnotationDateRangeValue(date: Date, allDay: boolean) {
const [startDate, endDate] = allDay
? [startOfDay(date), endOfDay(date)]
: [startOfHour(date), endOfHour(date)];
return `range:${startDate.getTime()}:${endDate.getTime()}`;
}