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,eAAnD,EAA4E,aAA5E,EAAiG;AACrG,SAAO,eAAe,IAAI,KAAK,CAAC,aAAzB,IAA0C,aAAa,IAAI,KAAK,CAAC,eAAxE;AACD","sourcesContent":["import {\n VTimestamp,\n parseTimestamp,\n getDayIdentifier,\n getTimestampIdentifier,\n} from './timestamp'\n\nexport interface VEventInput {\n [prop: string]: any\n}\n\nexport interface VEventParsed {\n input: VEventInput\n start: VTimestamp\n startIdentifier: number\n startTimestampIdentifier: number\n end: VTimestamp\n endIdentifier: number\n endTimestampIdentifier: number\n allDay: boolean\n index: number\n}\n\nexport function parseEvent (input: VEventInput, index: number, startProperty: string, endProperty: string): VEventParsed {\n if (!(startProperty in input)) {\n throw new Error('The ' + startProperty + ' property is required on all events to be a valid timestamp in the format YYYY-MM-DD or YYYY-MM-DD hh:mm')\n }\n\n const start: VTimestamp = parseTimestamp(input[startProperty]) as VTimestamp\n const end: VTimestamp = (input[endProperty] ? parseTimestamp(input[endProperty]) : start) as VTimestamp\n const startIdentifier: number = getDayIdentifier(start)\n const startTimestampIdentifier: number = getTimestampIdentifier(start)\n const endIdentifier: number = getDayIdentifier(end)\n const endTimestampIdentifier: number = getTimestampIdentifier(end)\n const allDay: boolean = !start.hasTime\n\n return { input, start, startIdentifier, startTimestampIdentifier, end, endIdentifier, endTimestampIdentifier, allDay, index }\n}\n\nexport function isEventOn (event: VEventParsed, dayIdentifier: number): boolean {\n return dayIdentifier >= event.startIdentifier && dayIdentifier <= event.endIdentifier\n}\n\nexport function isEventOverlapping (event: VEventParsed, startIdentifier: number, endIdentifier: number): boolean {\n return startIdentifier <= event.endIdentifier && endIdentifier >= event.startIdentifier\n}\n"],"sourceRoot":"","file":"events.js"} |