Skip to content

Commit

Permalink
add timeZoneList and CultureInfo
Browse files Browse the repository at this point in the history
Related to: #199
  • Loading branch information
sikutisa committed Oct 17, 2024
1 parent b5173d9 commit f04ffa0
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@using AzureOpenAIProxy.PlaygroundApp.Models
@using NodaTime
@using NodaTime.Extensions
@using System.Globalization

<FluentLayout Id="@Id">
@if(adminEventDetails == null)
Expand Down Expand Up @@ -112,6 +114,18 @@
private List<DateTimeZone>? timeZoneList = [];
private AdminEventDetails? adminEventDetails;

protected override void OnInitialized()
{
timeZoneList = DateTimeZoneProviders.Tzdb.GetAllZones().ToList();

CultureInfo customCulture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
customCulture.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
customCulture.DateTimeFormat.ShortTimePattern = "HH:mm";

CultureInfo.DefaultThreadCurrentCulture = customCulture;
CultureInfo.DefaultThreadCurrentUICulture = customCulture;
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if(firstRender)
Expand All @@ -128,7 +142,7 @@
Description = "dummy description",
DateStart = DateTimeOffset.Now,
DateEnd = DateTimeOffset.Now.AddDays(7),
TimeZone = "KST",
TimeZone = "Asia/Seoul",
IsActive = true,
OrganizerName = $"dummy organizer",
OrganizerEmail = $"[email protected]",
Expand Down

0 comments on commit f04ffa0

Please sign in to comment.