Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for external VTimezone generator #243

Merged
merged 5 commits into from
Apr 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(Readme): Add note about VTimezone support
sebbo2002 committed Apr 14, 2021
commit d85a6b6a138c216733c2972092d603289dbdcbfa
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,8 +69,29 @@ objects. You can also pass a string which is then passed to javascript's `Date`

It is recommended to use UTC time as far as possible. `ical-generator` will output all time information as UTC time as
long as no time zone is defined. For day.js, a plugin is necessary for this, which is a prerequisite. If a time zone is
set, `ical-generator` assumes that the given time matches the time zone. If a `moment-timezone` object or Luxon's
`setZone` method works, `ical-generator` sets it according to the time zone set in the calendar/event.
set, `ical-generator` assumes that the given time matches the time zone. If a time zone is used, it is also recommended
to use a VTimezone generator. Such a function generates a VTimezone entry and returns it. For example, ical-timezones can
be used for this:

```typescript
import ical from 'ical-generator';
import {getVtimezoneComponent} from '@touch4it/ical-timezones';

const cal = new ICalCalendar();
cal.timezone({
name: 'FOO',
generator: getVtimezoneComponent
});
cal.createEvent({
start: new Date(),
timezone: 'Europe/London'
});
```

If a `moment-timezone` object or Luxon's `setZone` method works, `ical-generator` sets it according to the time zone set
in the calendar/event.




## 🚦 Tests