{"id":18682728,"url":"https://github.com/chneau/openhours","last_synced_at":"2025-04-12T04:21:47.462Z","repository":{"id":57521326,"uuid":"173738285","full_name":"chneau/openhours","owner":"chneau","description":"A \"opening_hours\" from openstreetmap like","archived":false,"fork":false,"pushed_at":"2024-08-20T11:59:19.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T05:51:36.499Z","etag":null,"topics":["golang","opening-hours","schedule"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chneau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-04T12:10:41.000Z","updated_at":"2025-03-27T19:38:55.000Z","dependencies_parsed_at":"2024-11-11T16:15:52.063Z","dependency_job_id":null,"html_url":"https://github.com/chneau/openhours","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chneau%2Fopenhours","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chneau%2Fopenhours/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chneau%2Fopenhours/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chneau%2Fopenhours/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chneau","download_url":"https://codeload.github.com/chneau/openhours/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514444,"owners_count":21116963,"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":["golang","opening-hours","schedule"],"created_at":"2024-11-07T10:12:40.004Z","updated_at":"2025-04-12T04:21:47.438Z","avatar_url":"https://github.com/chneau.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openhours\n\nA compromise of complexity of the [\"opening_hours\"](https://wiki.openstreetmap.org/wiki/Key:opening_hours).  \nOnly the `day-day time-time\" will work for now.\n\n## Online tools\n\n\u003chttps://openingh.openstreetmap.de/evaluation_tool/?setLng=en\u003e\n\n## Example\n\n```go\noh := openhours.New(\"Mo-Fr 09:00-17:00\")\nt := time.Date(2019, 3, 6, 10, 0, 0, 0, time.Now().Location())\n// oh.Location = t.Location() //default to system but can be changed this way\n\nfmt.Println(\"t =\", t)\n\nisOpen := oh.Match(t)\nfmt.Println(\"Is it open at this date?\", isOpen)\n\n_, duration := oh.NextDur(t)\nfmt.Println(\"For how long?\", duration)\n\n_, date := oh.NextDate(t)\nfmt.Println(\"When will it close?\", date)\n\nfmt.Println(\" +++++++++++++++++++++ \")\n\nt = time.Date(2019, 3, 6, 18, 0, 0, 0, time.Now().Location())\n\nfmt.Println(\"t =\", t)\n\nisOpen, date = oh.NextDate(t)\nfmt.Println(\"Is it open?\", isOpen, \"Ok, when will it open then ?\", date)\n\n/* output\nt = 2019-03-06 10:00:00 +0000 GMT\nIs it open at this date? true\nFor how long? 7h0m0s\nWhen will it close? 2019-03-06 17:00:00 +0000 GMT\n +++++++++++++++++++++\nt = 2019-03-06 18:00:00 +0000 GMT\nIs it open? false Ok, when will it open then ? 2019-03-07 09:00:00 +0000 GMT\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchneau%2Fopenhours","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchneau%2Fopenhours","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchneau%2Fopenhours/lists"}