Skip to content

WIP: Cookbook example showing how to handle icalendar time zones #2894

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions docs/cookbook-icalendar-time-zone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Example of custom time zones with iCalendar data

The iCalendar data format allows specifying custom rules for time zone UTC offset changes.
Using the Temporal API directly, you can only make `Temporal.ZonedDateTime` instances with time zones that are available in your JS environment's version of the time zone database.
However, you can make a custom `ZonedDateTime` class that allows performing calculations with a custom time zone based on iCalendar rules.

```javascript
{{cookbook/icalendarTimeZones.mjs}}
```
7 changes: 7 additions & 0 deletions docs/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,10 @@ This calendar is currently not built in to JS environments.
This serves as an example of how to build support for calendars that are not widespread in browsers.

→ [Nepali calendar](cookbook-nepali-calendar.md)

### Custom time zone rules with iCalendar data

Use Temporal to perform time zone calculations with time zones not in the time zone database.
The iCalendar data format allows specifying custom rules for time zone UTC offset changes.

→ [iCalendar time zones](cookbook-icalendar-time-zone.md)
Loading