Skip to content

Commit 21af780

Browse files
Add calendar file (#107)
* Cal file * Update Calendar/README.md --------- Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com>
1 parent 7089c00 commit 21af780

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

Calendar/CompanyY_2024.calendar

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<calendar>
2+
<name>CompanyY_2024</name>
3+
<timeZone>America/New_York</timeZone>
4+
<language>en</language>
5+
<country>US</country>
6+
<firstValidDate>2024-01-01</firstValidDate>
7+
<lastValidDate>2024-12-31</lastValidDate>
8+
<description>
9+
Company Y calendar for the year 2024.
10+
Company Y uses two business periods instead of one.
11+
The periods are separated by a one hour lunch break.
12+
This calendar file defines standard business hours, weekends, and holidays.
13+
</description>
14+
<default>
15+
<businessTime><open>08:00</open><close>12:00</close><open>13:00</open><close>17:00</close></businessTime>
16+
<weekend>Saturday</weekend>
17+
<weekend>Sunday</weekend>
18+
</default>
19+
<holiday>
20+
<date>2024-01-01</date>
21+
</holiday>
22+
<holiday>
23+
<date>2024-01-15</date>
24+
</holiday>
25+
<holiday>
26+
<date>2024-02-19</date>
27+
</holiday>
28+
<holiday>
29+
<date>2024-03-29</date>
30+
</holiday>
31+
<holiday>
32+
<date>2024-04-01</date>
33+
<businessTime><open>08:00</open><close>12:00</close></businessTime>
34+
</holiday>
35+
<holiday>
36+
<date>2024-05-27</date>
37+
</holiday>
38+
<holiday>
39+
<date>2024-07-04</date>
40+
</holiday>
41+
<holiday>
42+
<date>2024-09-02</date>
43+
</holiday>
44+
<holiday>
45+
<date>2024-10-31</date>
46+
<businessTime><open>08:00</open><close>12:00</close></businessTime>
47+
</holiday>
48+
<holiday>
49+
<date>2024-11-28</date>
50+
</holiday>
51+
<holiday>
52+
<date>2024-11-29</date>
53+
</holiday>
54+
<holiday>
55+
<date>2024-12-25</date>
56+
</holiday>
57+
<holiday>
58+
<date>2024-12-26</date>
59+
</holiday>
60+
</calendar>

Calendar/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Calendar
2+
3+
This folder contains a calendar file in XML format.
4+
5+
## Table of contents
6+
7+
`CompanyY_2024.calendar`: A calendar file for a hypothetical company, `Company Y`, in XML format.
8+
9+
## Calendar file
10+
11+
A calendar file can be used by Deephaven's calendar API to add a custom calendar to the list of available calendars. This calendar file is used in Deephaven's documentation to show how this can be done.
12+
13+
## Use a custom calendar
14+
15+
Here's an example of the documentation for using a custom calendar:
16+
17+
```python
18+
from deephaven.calendar import add_calendar, calendar, calendar_names
19+
20+
add_calendar("https://media.githubusercontent.com/media/deephaven/examples/main/Calendar/CompanyY_2024.calendar")
21+
22+
print(calendar_names())
23+
24+
company_y_cal_2024 = calendar("CompanyY_2024")
25+
```

0 commit comments

Comments
 (0)