From 21af780cf33db54a3fb14abb28bf438044380834 Mon Sep 17 00:00:00 2001 From: JJ Brosnan <84038776+jjbrosnan@users.noreply.github.com> Date: Wed, 24 Jan 2024 12:24:23 -0500 Subject: [PATCH] Add calendar file (#107) * Cal file * Update Calendar/README.md --------- Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com> --- Calendar/CompanyY_2024.calendar | 60 +++++++++++++++++++++++++++++++++ Calendar/README.md | 25 ++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 Calendar/CompanyY_2024.calendar create mode 100644 Calendar/README.md diff --git a/Calendar/CompanyY_2024.calendar b/Calendar/CompanyY_2024.calendar new file mode 100644 index 0000000..9ce315b --- /dev/null +++ b/Calendar/CompanyY_2024.calendar @@ -0,0 +1,60 @@ + + CompanyY_2024 + America/New_York + en + US + 2024-01-01 + 2024-12-31 + + 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. + + + 08:0012:0013:0017:00 + Saturday + Sunday + + + 2024-01-01 + + + 2024-01-15 + + + 2024-02-19 + + + 2024-03-29 + + + 2024-04-01 + 08:0012:00 + + + 2024-05-27 + + + 2024-07-04 + + + 2024-09-02 + + + 2024-10-31 + 08:0012:00 + + + 2024-11-28 + + + 2024-11-29 + + + 2024-12-25 + + + 2024-12-26 + + diff --git a/Calendar/README.md b/Calendar/README.md new file mode 100644 index 0000000..d21a9d3 --- /dev/null +++ b/Calendar/README.md @@ -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") +``` \ No newline at end of file