1 import { toUTCDate } from '../date/timezone';
2 import type { DateTimeValue } from '../interfaces/calendar';
3 import type { VcalDateOrDateTimeProperty } from '../interfaces/calendar/VcalModel';
4 import { getDateProperty, getDateTimeProperty } from './vcalConverter';
6 export const createExdateMap = (exdate: VcalDateOrDateTimeProperty[] = []) => {
7 return exdate.reduce<{ [key: number]: boolean }>((acc, dateProperty: any) => {
8 const localExclude = toUTCDate(dateProperty.value);
9 acc[+localExclude] = true;
14 export const toExdate = (dateObject: DateTimeValue, isAllDay: boolean, tzid = 'UTC'): VcalDateOrDateTimeProperty => {
16 return getDateProperty(dateObject);
18 return getDateTimeProperty(dateObject, tzid);