Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make new rrule props top-level on event object. add better rrule types
- Loading branch information
Showing
3 changed files
with
105 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import { createDuration, identity, Identity } from '@fullcalendar/common' | ||
import { createDuration, DateInput, identity, Identity } from '@fullcalendar/common' | ||
import { Options as RRuleOptions } from 'rrule' | ||
|
||
// TODO: ask rrule maintainers to expose this | ||
// NOTE: we added `exdate` and `exrule` to this | ||
type RRuleOptions = any | ||
export type RRuleInputObjectFull = Omit<RRuleOptions, 'dtstart' | 'until' | 'freq' | 'wkst' | 'byweekday'> & { | ||
dtstart: RRuleOptions['dtstart'] | DateInput | ||
until: RRuleOptions['until'] | DateInput | ||
freq: RRuleOptions['until'] | string | ||
wkst: RRuleOptions['wkst'] | string | ||
byweekday: RRuleOptions['byweekday'] | string | ||
} | ||
|
||
export type RRuleInputObject = Partial<RRuleInputObjectFull> | ||
export type RRuleInput = RRuleInputObject | string | ||
|
||
export const RRULE_EVENT_REFINERS = { | ||
rrule: identity as Identity<RRuleOptions>, | ||
rrule: identity as Identity<RRuleInput>, | ||
exrule: identity as Identity<RRuleInputObject | RRuleInputObject[]>, | ||
exdate: identity as Identity<DateInput | DateInput[]>, | ||
duration: createDuration, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters