Skip to content

Commit 99ced20

Browse files
committed
Cookbook example showing how to handle iCalendar time zones
TODO: make sure it works
1 parent 2a9fec8 commit 99ced20

File tree

3 files changed

+506
-0
lines changed

3 files changed

+506
-0
lines changed

docs/cookbook-icalendar-time-zone.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Example of custom time zones with iCalendar data
2+
3+
The iCalendar data format allows specifying custom rules for time zone UTC offset changes.
4+
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.
5+
However, you can make a custom `ZonedDateTime` class that allows performing calculations with a custom time zone based on iCalendar rules.
6+
7+
```javascript
8+
{{cookbook/icalendarTimeZones.mjs}}
9+
```

docs/cookbook.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,3 +575,10 @@ This calendar is currently not built in to JS environments.
575575
This serves as an example of how to build support for calendars that are not widespread in browsers.
576576

577577
[Nepali calendar](cookbook-nepali-calendar.md)
578+
579+
### Custom time zone rules with iCalendar data
580+
581+
Use Temporal to perform time zone calculations with time zones not in the time zone database.
582+
The iCalendar data format allows specifying custom rules for time zone UTC offset changes.
583+
584+
[iCalendar time zones](cookbook-icalendar-time-zone.md)

0 commit comments

Comments
 (0)