Skip to content

Commit

Permalink
Update README to deprecate this project.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakamoto committed Apr 24, 2020
1 parent f4fdac9 commit b401575
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 92 deletions.
101 changes: 101 additions & 0 deletions README-OLD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 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/)

## Summary

This is a class library as a NuGet package for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.

This package provides system time zones set, and local time zone initialization, for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.

![fig. 1](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/master/.assets/fig-1-mini.png)

### Note

At 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.

See also:

- [Blazor Issue #663 - TimeZone issues related to Mono?](https://github.com/aspnet/Blazor/issues/663)
- [Blazor Issue #1166 - DateTime always displays as UTC](https://github.com/aspnet/Blazor/issues/1166)
- [Mono Issue #6368 - WebAssembly: Missing Timezone implementation](https://github.com/mono/mono/issues/6368)

## Supported Blazor versions

"Blazor WebAssembly App (client-side) Time Zone Kit" ver.7.x supports Blazor WebAssembly App versions **3.2 Preview 2~4.**

## How to install and use it?

**Step.1** - Install this package.

```shell
> dotnet add package Toolbelt.Blazor.TimeZoneKit
```

**Step.2** - Add calling `UseLocalTimeZone()` extension method in `Main()` method in your "Program.cs".

```csharp
...
using Toolbelt.Blazor.Extensions.DependencyInjection; // <!-- Add this line, and..
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
...
await builder
.Build()
.UseLocalTimeZone() // <!-- Add this!
.RunAsync();
...
```

That's all!

## How does it work?

There is no magic.

This library contains all the system time zone information as a C# code.
(see: ["TimeZoneKit.CreateSystemTimeZones.cs"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.CreateSystemTimeZones.cs#L16))
And, this library also contains mapping information for converting IANA time zone names to .NET time zone IDs.
(see: ["TimeZoneKit.IANAtoTZIdMap.cs"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.IANAtoTZIdMap.cs#L5))
`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.

`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.

### Note

- **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.
- In my test case, this package increased the size of the sample Blazor browser application content by 154 KB. (by 20KB gzip transfer.)

## Release Note

- **v.7.0.0**
- BREAKING CHANGE: Support Blazor v.3.2.0 Preview 2 (not compatible with v.3.2.0 Preview 1 or before.)
- **v.6.0.0**
- BREAKING CHANGE: Support Blazor v.3.2.0 Preview 1 (not compatible with v.3.1.0 Preview 4 or before.)
- Update time zone information
- Morocco Standard Time
- Fiji Standard Time
- **v.5.0.2**
- Update Central Brazilian Standard Time
- Update E. South America Standard Time
- **v.5.0.1** - Update West Bank Standard Time
- **v.5.0.0** - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
- **v.4.0.0** - BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)
- **v.3.0.0** - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
- **v.2.1.0**
- Blazor v.0.6.0 support - it was signed strong name.
- Update time zone information
- Morocco Standard Time
- Namibia Standard Time
- Fiji Standard Time
- **v.2.0.0** - BREAKING CHANGE: Fix namespace of TimeZoneKitExtension class.
- **v.1.0.0** - 1st release.

## License

[Mozilla Public License Version 2.0](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/master/LICENSE)
98 changes: 6 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,14 @@
# 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/)
# [Deprecated] 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/)

## Summary
## - Announcement -

This is a class library as a NuGet package for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.
Blazor WebAssembly v.3.2 Preview 5 has been started support .NET Time Zones! 🎉

This package provides system time zones set, and local time zone initialization, for [Blazor WebAssembly (client-side)](https://blazor.net/) browser application.
"Blazor WebAssembly App (client-side) Time Zone Kit" will no longer be maintained.

![fig. 1](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/master/.assets/fig-1-mini.png)
----

### Note

At 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.

See also:

- [Blazor Issue #663 - TimeZone issues related to Mono?](https://github.com/aspnet/Blazor/issues/663)
- [Blazor Issue #1166 - DateTime always displays as UTC](https://github.com/aspnet/Blazor/issues/1166)
- [Mono Issue #6368 - WebAssembly: Missing Timezone implementation](https://github.com/mono/mono/issues/6368)

## Supported Blazor versions

"Blazor WebAssembly App (client-side) Time Zone Kit" ver.7.x supports Blazor WebAssembly App versions **3.2 Preview 2~4.**

## How to install and use it?

**Step.1** - Install this package.

```shell
> dotnet add package Toolbelt.Blazor.TimeZoneKit
```

**Step.2** - Add calling `UseLocalTimeZone()` extension method in `Main()` method in your "Program.cs".

```csharp
...
using Toolbelt.Blazor.Extensions.DependencyInjection; // <!-- Add this line, and..
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
...
await builder
.Build()
.UseLocalTimeZone() // <!-- Add this!
.RunAsync();
...
```

That's all!

## How does it work?

There is no magic.

This library contains all the system time zone information as a C# code.
(see: ["TimeZoneKit.CreateSystemTimeZones.cs"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.CreateSystemTimeZones.cs#L16))
And, this library also contains mapping information for converting IANA time zone names to .NET time zone IDs.
(see: ["TimeZoneKit.IANAtoTZIdMap.cs"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/Toolbelt.Blazor.TimeZoneKit/TimeZoneKit.IANAtoTZIdMap.cs#L5))
`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.

`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.

### Note

- **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.
- In my test case, this package increased the size of the sample Blazor browser application content by 154 KB. (by 20KB gzip transfer.)

## Release Note

- **v.7.0.0**
- BREAKING CHANGE: Support Blazor v.3.2.0 Preview 2 (not compatible with v.3.2.0 Preview 1 or before.)
- **v.6.0.0**
- BREAKING CHANGE: Support Blazor v.3.2.0 Preview 1 (not compatible with v.3.1.0 Preview 4 or before.)
- Update time zone information
- Morocco Standard Time
- Fiji Standard Time
- **v.5.0.2**
- Update Central Brazilian Standard Time
- Update E. South America Standard Time
- **v.5.0.1** - Update West Bank Standard Time
- **v.5.0.0** - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
- **v.4.0.0** - BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)
- **v.3.0.0** - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
- **v.2.1.0**
- Blazor v.0.6.0 support - it was signed strong name.
- Update time zone information
- Morocco Standard Time
- Namibia Standard Time
- Fiji Standard Time
- **v.2.0.0** - BREAKING CHANGE: Fix namespace of TimeZoneKitExtension class.
- **v.1.0.0** - 1st release.
For users who are using Blazor WebAssembly v.3.2 Preview 4 or before, please see ["README-OLD"](https://github.com/jsakamoto/Toolbelt.Blazor.TimeZoneKit/blob/master/README-OLD.md).

## License

Expand Down

0 comments on commit b401575

Please sign in to comment.