{"id":22101155,"url":"https://github.com/rmja/setling","last_synced_at":"2025-03-24T02:20:05.359Z","repository":{"id":96149593,"uuid":"146610035","full_name":"rmja/Setling","owner":"rmja","description":"A time settle library for NodaTime","archived":false,"fork":false,"pushed_at":"2022-02-23T16:01:05.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T08:25:43.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-08-29T14:12:16.000Z","updated_at":"2021-11-19T15:46:15.000Z","dependencies_parsed_at":"2023-04-10T08:49:43.329Z","dependency_job_id":null,"html_url":"https://github.com/rmja/Setling","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/rmja%2FSetling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmja%2FSetling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmja%2FSetling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmja%2FSetling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmja","download_url":"https://codeload.github.com/rmja/Setling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245196019,"owners_count":20575951,"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":[],"created_at":"2024-12-01T05:23:46.597Z","updated_at":"2025-03-24T02:20:05.297Z","avatar_url":"https://github.com/rmja.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setling\nA time settle library for NodaTime.\n\n# Usage\n\n```C#\nvar timezone = DateTimeZoneProviders.Tzdb[\"Europe/Copenhagen\"];\nvar now = DateTimeOffset.UtcNow.ToZonedDateTime().WithZone(timezone);\n\nvar rule = SettleRule.Parse(\"day+PT2H\"); // Equivalent to _day+PT2H\nvar startOfTodayPlusTwoHours = rule.Settle(now);\n\nvar rule = SettleRule.Parse(\"^day+PT2H\");\nvar startOfTomorrowPlusTwoHours = rule.Settle(now);\n\nvar rule = SettleRule.Parse(\"~day+PT2H\");\nvar startOfTodayOrTomorrowPlusTwoHours = rule.Settle(now);\n```\n\nThe rule string can consist of any of the following parts:\n* A rounding to start of `_`, end of `^`, or nearest `~` of any of the intervals:\n`second`,\n`minute`,\n`hour`,\n`day`,\n`month`,\n`quarter`,\n`year`,\n`monday`,\n`tuesday`,\n`wednesday`,\n`thursday`,\n`friday`,\n`saturday`,\n`sunday`,\n`january`,\n`february`,\n`march`,\n`april`,\n`may`,\n`june`,\n`july`,\n`august`,\n`september`,\n`october`,\n`november`,\n`december`,\n`season`,\n`spring`,\n`summer`,\n`autumn`,\n`winter`,\n* Plus/minus a period according to ISO8601, e.g. PT2H (two hours)\n\nThe parts can be chained in any way, for examle: `day+PT2H_month~year-P7D`. This will take the input time through the following process: Find the start of the day, add two hours, find the start of the month, find the nearest year, subtract 7 days.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmja%2Fsetling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmja%2Fsetling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmja%2Fsetling/lists"}