Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after install persian language (fa) #3282

Closed
prgakbarzadeh opened this issue Sep 21, 2023 · 3 comments
Closed

after install persian language (fa) #3282

prgakbarzadeh opened this issue Sep 21, 2023 · 3 comments

Comments

@prgakbarzadeh
Copy link

prgakbarzadeh commented Sep 21, 2023

ArgumentOutOfRangeException: Specified time is not supported in this calendar. It should be between 0001/1/1 0:00:00 (Gregorian date) and 9378/10/13 23:59:59 (Gregorian date), inclusive. (Parameter 'time') Actual value was 0.

System.Globalization.PersianCalendar.CheckTicksRange(long ticks)
System.Globalization.PersianCalendar.GetDatePart(long ticks, int part)
System.Globalization.PersianCalendar.GetYear(DateTime time)
System.DateTimeFormat.FormatCustomized(DateTime dateTime, ReadOnlySpan format, DateTimeFormatInfo dtfi, TimeSpan offset, ref ValueStringBuilder result)
System.DateTimeFormat.FormatStringBuilder(DateTime dateTime, ReadOnlySpan format, DateTimeFormatInfo dtfi, TimeSpan offset, ref ValueStringBuilder result)
System.DateTimeFormat.Format(DateTime dateTime, string format, IFormatProvider provider, TimeSpan offset)
Oqtane.Services.SyncService.GetSyncEventsAsync(DateTime lastSyncDate) in SyncService.cs

21. return await GetJsonAsync<Sync>($"{ApiUrl}/{lastSyncDate.ToString("yyyyMMddHHmmssfff")}");

Oqtane.UI.SiteRouter.Refresh() in SiteRouter.razor
173. var sync = await SyncService.GetSyncEventsAsync(lastsyncdate);
Oqtane.UI.SiteRouter.OnParametersSetAsync() in SiteRouter.razor
72. await Refresh();
Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()

@sbwalker
Copy link
Member

I am not sure how this could happen. lastSyncDate is initialized to DateTime.MinValue for a new request and ToString("yyyyMMddHHmmssfff") converts it to a string. This would seem to be a bug in the PersianCalendar class?

@Mostafa-Moafi
Copy link
Contributor

I also have this problem after installation and occurred below error :
Also, I have added the Persian language for this project in Oqtane.Translations, why is it not checked yet?

[2023-09-26 17:02:37+00:00] [Error] Connection ID "18230571306091282446", Request ID "8000001a-0003-fd00-b63f-84710c7967bb": An unhandled exception was thrown by the application.
at System.Globalization.PersianCalendar.CheckTicksRange(Int64 ticks)
at System.Globalization.PersianCalendar.GetDatePart(Int64 ticks, Int32 part)
at System.Globalization.PersianCalendar.GetYear(DateTime time)
at System.DateTimeFormat.FormatCustomized(DateTime dateTime, ReadOnlySpan1 format, DateTimeFormatInfo dtfi, TimeSpan offset, ValueStringBuilder& result) at System.DateTimeFormat.FormatStringBuilder(DateTime dateTime, ReadOnlySpan1 format, DateTimeFormatInfo dtfi, TimeSpan offset, ValueStringBuilder& result)
at System.DateTimeFormat.Format(DateTime dateTime, String format, IFormatProvider provider, TimeSpan offset)
at Oqtane.Services.SyncService.GetSyncEventsAsync(DateTime lastSyncDate) in C:\Source\Projects\oqtane.framework\Oqtane.Client\Services\SyncService.cs:line 21
at Oqtane.UI.SiteRouter.Refresh() in C:\Source\Projects\oqtane.framework\Oqtane.Client\UI\SiteRouter.razor:line 173
at Oqtane.UI.SiteRouter.OnParametersSetAsync() in C:\Source\Projects\oqtane.framework\Oqtane.Client\UI\SiteRouter.razor:line 72
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

@sbwalker
Copy link
Member

@Mostafa-Moafi I apologize... I was under the impression that another team member was merging the PRs in the localization repo... but it appears that is not the case. I will merge your PR now.

Mostafa-Moafi added a commit to Mostafa-Moafi/oqtane.framework that referenced this issue Sep 28, 2023
sbwalker added a commit that referenced this issue Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants