{"id":22827498,"url":"https://github.com/kipcole9/calendrical","last_synced_at":"2025-04-23T14:02:37.172Z","repository":{"id":57481978,"uuid":"95612188","full_name":"kipcole9/calendrical","owner":"kipcole9","description":"Calendars and Calendar Calculations for Elixir","archived":false,"fork":false,"pushed_at":"2018-04-01T04:15:10.000Z","size":61,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T16:45:20.321Z","etag":null,"topics":["calendars","calendrical-calculations","elixir","k-day"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kipcole9.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-28T00:28:56.000Z","updated_at":"2023-05-14T14:40:16.000Z","dependencies_parsed_at":"2022-09-02T04:20:17.894Z","dependency_job_id":null,"html_url":"https://github.com/kipcole9/calendrical","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipcole9%2Fcalendrical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipcole9%2Fcalendrical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipcole9%2Fcalendrical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipcole9%2Fcalendrical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kipcole9","download_url":"https://codeload.github.com/kipcole9/calendrical/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250446913,"owners_count":21432109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendars","calendrical-calculations","elixir","k-day"],"created_at":"2024-12-12T18:12:24.843Z","updated_at":"2025-04-23T14:02:37.141Z","avatar_url":"https://github.com/kipcole9.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calendrical\n\n  `Calendrical ` provides calendar-related functions that build upon the\n  conversion capabilities of `Calendar` available in Elixir from verison 1.5.0.\n\n  `Calendrical` implements:\n\n  * K-Day calculations in `Calendrical.Kday`\n\n## Example Usage\n\n`Date.new/4` is used to create a calendar with the default calendar being `Calendar.ISO`.  To create a date using one of the `Calendrical` calendars simply:\n\n    iex\u003e Date.new(2017,1,1,Calendrical.Calendar.Gregorian)\n    {:ok,\n     %Date{calendar: Calendrical.Calendar.Gregorian, day: 1, month: 1, year: 2017}}\n\n    iex\u003e Date.new(2017,1,1,Calendrical.Calendar.Egyptian)\n    {:ok,\n     %Date{calendar: Calendrical.Calendar.Egyptian, day: 1, month: 1, year: 2017}}\n\nTo convert a date from one calendar to another use the `Date.convert/2` or `Date.convert!/2` functions.  For example:\n\n    iex\u003e Date.convert! ~D[2016-07-01], Calendrical.Calendar.Julian\n    %Date{calendar: Calendrical.Calendar.Julian, day: 18, month: 6, year: 2016}\n\nNote that dates can only be converted if the calendars both have the same definition of the start of day.  Some calendars define the start of day various as sunrise, sunset, noon and midnight.   To convert calendars with different notions of when the day starts the time of day will need to be specified hence `DateTime.convert/2` is required.\n\n    iex\u003e dt1 = %DateTime{calendar: Calendar.ISO, day: 29, hour: 23, microsecond: {0, 0},\n     minute: 0, month: 2, second: 7, std_offset: 0, time_zone: \"America/Manaus\",\n     utc_offset: -14400, year: 2000, zone_abbr: \"AMT\"}\n\n    iex\u003e DateTime.convert(dt1, Calendrical.Calendar.Julian)\n    {:ok,\n     %DateTime{calendar: Calendrical.Calendar.Julian, day: 16, hour: 23, microsecond: {0, 6},\n      minute: 0, month: 2, second: 7, std_offset: 0, time_zone: \"America/Manaus\",\n      utc_offset: -14400, year: 2000, zone_abbr: \"AMT\"}}\n\n## Roadmap\n\n  - [ ] Date and time formatting which will be done in a locale sensitive way through the [ex_cldr](https://hex.pm/packages/ex_cldr) package after it is updated to provide that support.  Expected in July 2017.\n\n  - [ ] Hebrew and Islamic calendars (the arithmetic versions) are expected to land in July 2017\n\n  - [ ]  Astronomical calendar types will be implemented but only after the required astronomy library is built (ie not expected before year end 2017)\n\n## Elixir Version Support\n\n`Calendrical` requires Elixir 1.5 or later.  It is tested on Elixir 1.5.0-rc.0\n\n## Installation\n\n1. Add `calendrical` to your list of dependencies in `mix.exs`:\n\n```elixir\n    def deps do\n      [{:calendrical, \"~\u003e 0.1.2\"}]\n    end\n```\n\n2. Ensure `calendrical` is started before your application:\n\n```elixir\n    def application do\n      [applications: [:calendrical]]\n    end\n```\n\nThe docs can be found at [https://hexdocs.pm/calendrical](https://hexdocs.pm/calendrical)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkipcole9%2Fcalendrical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkipcole9%2Fcalendrical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkipcole9%2Fcalendrical/lists"}