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

Bug: Custom date format breaks repos #449

Open
2 tasks done
BreadKat0707 opened this issue Dec 31, 2023 · 7 comments
Open
2 tasks done

Bug: Custom date format breaks repos #449

BreadKat0707 opened this issue Dec 31, 2023 · 7 comments
Assignees
Labels
type/bug This issue reports an unwanted behavior.

Comments

@BreadKat0707
Copy link

Before you start

  • Have you updated FluentHub? You might be using an old version.
  • Have you checked if a similar issue has already been reported?

What version of Windows is this issue present?

Windows 11 Dev

What version/architecture of FluentHub are you on?

0.8.60.0 | X64 | RELEASE

Description

When I try to open a repository, the page content flashes and then says Something went wrong string "time" was not recognized as a valid datetime
图片

Steps To Reproduce

No response

Expected behavior

Successfully open a repo page

Stack Trace

Stack trace details

at System.DateTimeOffset.Parse(String input)
at FluentHub.Octokit.Queries.Repositories.TreeQueries.GetWithObjectNameAsync(String name, String owner, String refs, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadRepositoryContentsAsync(String login, String name, String branch, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadDetailsViewPageAsync()

Assets

2023-12-31 22:18:50.777 +08:00 [ERR] LoadRepositoryContentsAsync
System.FormatException: String '2023.12.31.星期日 上午 08:28:59' was not recognized as a valid DateTime.
at System.DateTimeOffset.Parse(String input)
at FluentHub.Octokit.Queries.Repositories.TreeQueries.GetWithObjectNameAsync(String name, String owner, String refs, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadRepositoryContentsAsync(String login, String name, String branch, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadDetailsViewPageAsync()
2023-12-31 22:20:18.782 +08:00 [ERR] LoadRepositoryContentsAsync
System.FormatException: String '2023.03.29.星期三 上午 10:04:46' was not recognized as a valid DateTime.
at System.DateTimeOffset.Parse(String input)
at FluentHub.Octokit.Queries.Repositories.TreeQueries.GetWithObjectNameAsync(String name, String owner, String refs, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadRepositoryContentsAsync(String login, String name, String branch, String path)
at FluentHub.App.ViewModels.Repositories.Codes.DetailsLayoutViewModel.LoadDetailsViewPageAsync()

@BreadKat0707 BreadKat0707 added the type/bug This issue reports an unwanted behavior. label Dec 31, 2023
@0x5bfa
Copy link
Owner

0x5bfa commented Jan 11, 2024

Thank you for the feedback. I guess Chinese version date time string is not recognized as a valid DataTime conversion target. I'm gonna investigate the cause and fix, but note that I don't have much time these days.

@0x5bfa 0x5bfa self-assigned this Jan 11, 2024
@github-project-automation github-project-automation bot moved this to 📋 To do in FluentHub Board Jul 21, 2024
@Lamparter Lamparter changed the title App could not load a repository page Bug: Chinese DateTime not recognised Jul 22, 2024
@Lamparter Lamparter changed the title Bug: Chinese DateTime not recognised Bug: Non-system date format not recognised Sep 21, 2024
@Lamparter Lamparter changed the title Bug: Non-system date format not recognised Bug: Custom date format breaks repos Sep 21, 2024
@Lamparter
Copy link
Collaborator

This issue is not related to Chinese DateTime format. Instead, it is about the date format being set in a format that is not default for the system, as explained by @just.a.hriday on Discord:

Oh I know the problem
I've gone and changed the windows short date format to a custom format
Because I wanted to see the day of the week in the taskbar
So ddd, d MMMM isn't a format microsoft expects
And DateTime.Parse doesn't support it
But yeah, it's the same thing as in the issue you mentioned - the user's computer has a short date format that DateTime.Parse doesn't support.
I wonder what you could do about that though

@Lamparter
Copy link
Collaborator

Lamparter commented Sep 21, 2024

Cannot reproduce after 4 attempts with different time format combinations, exactly matching the ones shown by @BreadKat0707 and @just.a.hriday 😕
image
image

@just-a-hriday
Copy link

It's also weird to me that the bug for me occured on the date of a seemingly random commit from the repository. Why not one of the other commits?

@just-a-hriday
Copy link

Cannot reproduce after 4 attempts with different time format combinations, exactly matching the ones shown by @BreadKat0707 and @just.a.hriday 😕

Looks like you've changed the time format - the issue is with the short date one.

@Lamparter
Copy link
Collaborator

Cannot reproduce after 4 attempts with different time format combinations, exactly matching the ones shown by @BreadKat0707 and @just.a.hriday 😕

Looks like you've changed the time format - the issue is with the short date one.

How do you mean?

@just-a-hriday
Copy link

screenshot of Customize Format dialog
The bug seems to be caused by the Short date format. The one in your screenshot is supported by DateTime.Parse(), but mine is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug This issue reports an unwanted behavior.
Projects
Status: 📋 To do
Development

No branches or pull requests

4 participants