Add website annotations with chart markers and CRUD management
This commit is contained in:
1 parent
eea124bbf8
commit
64e4cc1c3b
24 files changed
+957
-3
No files matched your search
@@ -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()}`;
|
||||
}
|
||||
Reference in new issue
Block a user