Skip to content

Commit

Permalink
fix: allow X-attrs to be specified in constructor (#185)
Browse files Browse the repository at this point in the history
## What

- whitelist `x` in constructor

## Why

- allow this to be specified via passed in object, for example:

```
ical({
    domain: 'sebbo.net',
    prodId: '//superman-industries.com//ical-generator//EN',
    events: [
        {
            start: moment(),
            end: moment().add(1, 'hour'),
            timestamp: moment(),
            summary: 'My Event',
            organizer: 'Sebastian Pekarek <[email protected]>',
            x: [
              ['LANGUAGE', 'en-GB']
            ]
        }
    ]
});
```
  • Loading branch information
bguiz authored Mar 27, 2020
1 parent 7e9071d commit 58c1ae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class ICalEvent {
'url',
'created',
'lastModified',
'recurrenceId'
'recurrenceId',
'x'
];
this._vars = {
allowedRepeatingFreq: ['SECONDLY', 'MINUTELY', 'HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY'],
Expand Down

0 comments on commit 58c1ae5

Please sign in to comment.