{"id":20084580,"url":"https://github.com/dhtmlx/scheduler-recurring-events-dotnet","last_synced_at":"2025-05-06T01:32:08.441Z","repository":{"id":41936293,"uuid":"225673662","full_name":"DHTMLX/scheduler-recurring-events-dotnet","owner":"DHTMLX","description":"# Recurring Events Helper for dhtmlxScheduler on ASP.NET/ASP.NET Core backends","archived":false,"fork":false,"pushed_at":"2022-07-07T14:20:23.000Z","size":15,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T06:50:52.274Z","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/DHTMLX.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}},"created_at":"2019-12-03T17:04:59.000Z","updated_at":"2024-03-05T19:03:24.000Z","dependencies_parsed_at":"2022-07-10T20:33:08.520Z","dependency_job_id":null,"html_url":"https://github.com/DHTMLX/scheduler-recurring-events-dotnet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DHTMLX%2Fscheduler-recurring-events-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DHTMLX%2Fscheduler-recurring-events-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DHTMLX%2Fscheduler-recurring-events-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DHTMLX%2Fscheduler-recurring-events-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DHTMLX","download_url":"https://codeload.github.com/DHTMLX/scheduler-recurring-events-dotnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252604392,"owners_count":21775095,"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-11-13T15:52:30.679Z","updated_at":"2025-05-06T01:32:08.124Z","avatar_url":"https://github.com/DHTMLX.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recurring Events Helper for dhtmlxScheduler on ASP.NET/ASP.NET Core backends\n\nA helper library for parsing recurring events of [dhtmlxScheduler](https://docs.dhtmlx.com/scheduler/) on ASP.NET/ASP.NET Core backends.\n\n## Supported Frameworks\n\n- .NET 4.5+\n- .NET Core 1.0+\n\n## Install\n\n### Package Manager Console\n\n```\nPM\u003e Install-Package DHTMLX.Scheduler.RecurringEvents\n```\n\n### .NET CLI Console\n\n```\n\u003e dotnet add package DHTMLX.Scheduler.RecurringEvents\n```\n\n## Usage\n\n### Overview\n\nThe main class is **RecurringEventsHelper** which is defined in **DHTMLX.Scheduler.RecurringEvents** namespace.\n\nThe only public method **GetOccurrences** takes a list of event entries in the same form they are stored in the database, and outputs the list of processed records:\n\n- entries that represent recurring series will be replaced with individual occurrences of the series. Each occurrence will have its own start and end dates\n- single events won't be modified\n- records that represent deleted occurrences will be removed from the result\n\n\n### Basic usage\n\nAdd the namespace:\n\n```\nusing DHTMLX.Scheduler.RecurringEvents;\n```\n\nAnd use:\n\n```\n\n// SchedulerEvent is defined in DHTMLX.Scheduler.RecurringEvents namespace\nvar data = new List\u003cSchedulerEvent\u003e\n{\n    new SchedulerEvent(){\n        id = \"1\",\n        text = \"Every Thursday\",\n        start_date = new DateTime(2019, 10, 03, 01, 05, 00),\n        end_date = new DateTime(9999, 01, 02),\n        event_length = 8400,\n        rec_type = \"week_1___4#no\",\n        event_pid = null\n\t}\n};\n\nvar helper = new RecurringEventsHelper();\nvar items = helper.GetOccurrences(data, new DateTime(2019, 11, 1), new DateTime(2019, 11, 15));\n// items:\n// [ \n//   { id = 1, text = Every Thursday, start_date = 2019-11-07 01:05, end_date = 2019-11-07 03:25, },\n//\t { id = 1, text = Every Thursday, start_date = 2019-11-14 01:05, end_date = 2019-11-14 03:25, }\n// ]\n```\n\nIn order to use the helper with custom model classes, you'll need to manually convert them to **DHTMLX.Scheduler.RecurringEvents.SchedulerEvent** for **GetOccurrences** method:\n\n```\n// get events scheduled for next three days\nvar currentDate = DateTime.Now;\nvar upUntilDate = currentDate.AddDays(3);\n\nvar rawEvents = _context.RecurringEvents.Where(e =\u003e e.StartDate \u003c upUntilDate \u0026\u0026 e.EndDate \u003e currentDate);\nvar helper = new RecurringEventsHelper();\n\nvar upcomingEvents = helper.GetOccurrences(\n    rawEvents.Select(e =\u003e new SchedulerEvent\n    {\n        id = e.Id.ToString(),\n        text = e.Name,\n        start_date = e.StartDate,\n        end_date = e.EndDate,\n        event_length = e.EventLength,\n        event_pid = e.EventPID.ToString(),\n        rec_type = e.RecType\n    }).ToList(),\n    currentDate,\n    upUntilDate\n);\n```\n\n### UTC Dates\n\nIf you use [occurrence_timestamp_in_utc](https://docs.dhtmlx.com/scheduler/api__scheduler_occurrence_timestamp_in_utc_config.html) config on the client, you'll need to specify it on the backend as well:\n\n```\nvar helper = new RecurringEventsHelper\n{\n    OccurrenceTimestampInUtc = true\n};\n```\n\n## License\n\nCopyright (c) 2019 XB Software Ltd.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE\nOR OTHER DEALINGS IN THE SOFTWARE.\n\n\n## Useful links\n\n- [dhtmlxScheduler product page](https://dhtmlx.com/docs/products/dhtmlxScheduler)\n- [dhtmlxScheduler documentation](https://docs.dhtmlx.com/scheduler/)\n- [Support forum](https://forum.dhtmlx.com/c/scheduler-all)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhtmlx%2Fscheduler-recurring-events-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhtmlx%2Fscheduler-recurring-events-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhtmlx%2Fscheduler-recurring-events-dotnet/lists"}