Skip to content

Commit

Permalink
Add calendar file (#107)
Browse files Browse the repository at this point in the history
* Cal file

* Update Calendar/README.md

---------

Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com>
  • Loading branch information
jjbrosnan and margaretkennedy authored Jan 24, 2024
1 parent 7089c00 commit 21af780
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
60 changes: 60 additions & 0 deletions Calendar/CompanyY_2024.calendar
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<calendar>
<name>CompanyY_2024</name>
<timeZone>America/New_York</timeZone>
<language>en</language>
<country>US</country>
<firstValidDate>2024-01-01</firstValidDate>
<lastValidDate>2024-12-31</lastValidDate>
<description>
Company Y calendar for the year 2024.
Company Y uses two business periods instead of one.
The periods are separated by a one hour lunch break.
This calendar file defines standard business hours, weekends, and holidays.
</description>
<default>
<businessTime><open>08:00</open><close>12:00</close><open>13:00</open><close>17:00</close></businessTime>
<weekend>Saturday</weekend>
<weekend>Sunday</weekend>
</default>
<holiday>
<date>2024-01-01</date>
</holiday>
<holiday>
<date>2024-01-15</date>
</holiday>
<holiday>
<date>2024-02-19</date>
</holiday>
<holiday>
<date>2024-03-29</date>
</holiday>
<holiday>
<date>2024-04-01</date>
<businessTime><open>08:00</open><close>12:00</close></businessTime>
</holiday>
<holiday>
<date>2024-05-27</date>
</holiday>
<holiday>
<date>2024-07-04</date>
</holiday>
<holiday>
<date>2024-09-02</date>
</holiday>
<holiday>
<date>2024-10-31</date>
<businessTime><open>08:00</open><close>12:00</close></businessTime>
</holiday>
<holiday>
<date>2024-11-28</date>
</holiday>
<holiday>
<date>2024-11-29</date>
</holiday>
<holiday>
<date>2024-12-25</date>
</holiday>
<holiday>
<date>2024-12-26</date>
</holiday>
</calendar>
25 changes: 25 additions & 0 deletions Calendar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Calendar

This folder contains a calendar file in XML format.

## Table of contents

`CompanyY_2024.calendar`: A calendar file for a hypothetical company, `Company Y`, in XML format.

## Calendar file

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.

## Use a custom calendar

Here's an example of the documentation for using a custom calendar:

```python
from deephaven.calendar import add_calendar, calendar, calendar_names

add_calendar("https://media.githubusercontent.com/media/deephaven/examples/main/Calendar/CompanyY_2024.calendar")

print(calendar_names())

company_y_cal_2024 = calendar("CompanyY_2024")
```

0 comments on commit 21af780

Please sign in to comment.