{"id":13824131,"url":"https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit","last_synced_at":"2025-07-08T19:30:51.793Z","repository":{"id":66230937,"uuid":"145998037","full_name":"jsakamoto/Toolbelt.Blazor.TimeZoneKit","owner":"jsakamoto","description":"Provides system time zones set, and local time zone initialization, for Blazor (client-side) browser application.","archived":false,"fork":false,"pushed_at":"2020-04-24T14:08:09.000Z","size":1147,"stargazers_count":35,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-15T05:41:53.534Z","etag":null,"topics":["blazor","mono","timezone"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsakamoto.png","metadata":{"files":{"readme":"README-OLD.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}},"created_at":"2018-08-24T13:55:49.000Z","updated_at":"2024-04-17T09:20:31.000Z","dependencies_parsed_at":"2024-01-18T05:09:46.590Z","dependency_job_id":"743518e5-fa33-4df4-8e44-89d1ce3747b9","html_url":"https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TimeZoneKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TimeZoneKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TimeZoneKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TimeZoneKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsakamoto","download_url":"https://codeload.github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225457747,"owners_count":17477348,"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":["blazor","mono","timezone"],"created_at":"2024-08-04T09:00:57.305Z","updated_at":"2024-11-20T02:30:23.509Z","avatar_url":"https://github.com/jsakamoto.png","language":"C#","funding_links":[],"categories":["Libraries \u0026 Extensions"],"sub_categories":["Tools \u0026 Utilities"],"readme":"# Blazor WebAssembly App (client-side) Time Zone Kit [![NuGet Package](https://img.shields.io/nuget/v/Toolbelt.Blazor.TimeZoneKit.svg)](https://www.nuget.org/packages/Toolbelt.Blazor.TimeZoneKit/)\n\n## Summary\n\nThis is a class library as a NuGet package for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.\n\nThis package provides system time zones set, and local time zone initialization, for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.\n\n![fig. 1](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/master/.assets/fig-1-mini.png)\n\n### Note\n\nAt this time, the latest version of the client-side Blazor WebAssembly app is v.3.2 Preview 4, it doesn't contain any time zone info, and local time zone is always UTC wherever.\n\nSee also: \n\n- [Blazor Issue #663 - TimeZone issues related to Mono?](https://github.com/aspnet/Blazor/issues/663)\n- [Blazor Issue #1166 - DateTime always displays as UTC](https://github.com/aspnet/Blazor/issues/1166)\n- [Mono Issue #6368 - WebAssembly: Missing Timezone implementation](https://github.com/mono/mono/issues/6368)\n\n## Supported Blazor versions\n\n\"Blazor WebAssembly App (client-side) Time Zone Kit\" ver.7.x supports  Blazor WebAssembly App versions **3.2 Preview 2~4.**\n\n## How to install and use it?\n\n**Step.1** - Install this package.\n\n```shell\n\u003e dotnet add package Toolbelt.Blazor.TimeZoneKit\n```\n\n**Step.2** - Add calling `UseLocalTimeZone()` extension method in `Main()` method in your \"Program.cs\".\n\n```csharp\n...\nusing Toolbelt.Blazor.Extensions.DependencyInjection; // \u003c!-- Add this line, and..\n\npublic class Program\n{\n    public static async Task Main(string[] args)\n    {\n        var builder = WebAssemblyHostBuilder.CreateDefault(args);\n        builder.RootComponents.Add\u003cApp\u003e(\"app\");\n        ...\n        await builder\n            .Build()\n            .UseLocalTimeZone() // \u003c!-- Add this!\n            .RunAsync();\n        ...\n```\n\nThat's all!\n\n## How does it work?\n\nThere is no magic.\n\nThis library contains all the system time zone information as a C# code.  \n(see: [\"TimeZoneKit.CreateSystemTimeZones.cs\"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.CreateSystemTimeZones.cs#L16))\n\nAnd, this library also contains mapping information for converting IANA time zone names to .NET time zone IDs.  \n(see: [\"TimeZoneKit.IANAtoTZIdMap.cs\"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.IANAtoTZIdMap.cs#L5))\n\n`UseLocalTimeZone()` extension method in this library invokes `\"Intl.DateTimeFormat().resolvedOptions().timeZone\"` JavaScript code to get the current time zone name (IANA name) on the web browser.\n\n`UseLocalTimeZone()` extension method also set up the system time zone set and local time zone information by accessing undocumented / non public members in `System.TimeZoneInfo` class.\n\n### Note\n\n- **WARNING** - This library accesses private members of `System.TimeZoneInfo` using the \"Reflection\" .NET API, so it may break in future .NET runtime (mono.wasm) release.\n- In my test case, this package increased the size of the sample Blazor browser application content by 154 KB. (by 20KB gzip transfer.)\n\n## Release Note\n\n- **v.7.0.0**\n  - BREAKING CHANGE: Support Blazor v.3.2.0 Preview 2 (not compatible with v.3.2.0 Preview 1 or before.)\n- **v.6.0.0**\n  - BREAKING CHANGE: Support Blazor v.3.2.0 Preview 1 (not compatible with v.3.1.0 Preview 4 or before.)\n  - Update time zone information\n    - Morocco Standard Time\n    - Fiji Standard Time\n- **v.5.0.2**\n    - Update Central Brazilian Standard Time\n    - Update E. South America Standard Time\n- **v.5.0.1** - Update West Bank Standard Time\n- **v.5.0.0** - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)\n- **v.4.0.0** - BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)\n- **v.3.0.0** - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)\n- **v.2.1.0**\n  - Blazor v.0.6.0 support - it was signed strong name.  \n  - Update time zone information\n    - Morocco Standard Time\n    - Namibia Standard Time\n    - Fiji Standard Time\n- **v.2.0.0** - BREAKING CHANGE: Fix namespace of TimeZoneKitExtension class.\n- **v.1.0.0** - 1st release.\n\n## License\n\n[Mozilla Public License Version 2.0](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TimeZoneKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TimeZoneKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TimeZoneKit/lists"}