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

FAchievementSort: fix parsing US date formats #1910

Merged
merged 3 commits into from
Jul 20, 2024

Conversation

candela97
Copy link
Collaborator

@candela97 candela97 commented Apr 23, 2024

Test the format before getting date formats if language is English. I'm starting to wonder if there're other unstable locales 😥. Fixes #1908.

@candela97 candela97 force-pushed the fix-ach-sort-locale branch from f8ea4d8 to 1d3212d Compare July 14, 2024 16:10
@candela97 candela97 marked this pull request as ready for review July 14, 2024 16:16
@tfedor
Copy link
Member

tfedor commented Jul 19, 2024

I wonder if we can just ignore languages completely, just make a large list of known date formats, and iterate that one, until we hit the format that can be parsed - you basically already do something like this, but in a more convoluted way.

It should simplify all these language shenanigans, since we see they're also not reliable.

@candela97
Copy link
Collaborator Author

Yeah regexes will be more flexible, but luxons format is straightforward and handy 😥. Or maybe just load the page in a locale that's stable and easy to parse? SteamDB uses finnish https://steamdb.info/blog/extension-achievements-update/

@tfedor
Copy link
Member

tfedor commented Jul 20, 2024

Can't we just send string with a luxon format to luxon, and see if it throws or not? It should be throwing exception if it fails to parse, right?

If not, we can do what SteamDb does, we already have a solution to load the page in English, we could've been smarter and do some other language like they do 🤷

@candela97
Copy link
Collaborator Author

We can go with Czech I suppose 😂. But that means we'll need to remove English formats because it's unstable...

@tfedor
Copy link
Member

tfedor commented Jul 20, 2024

That's fine with me, it would simplify it at least. Shame we need to do extra request though.

@tfedor tfedor merged commit 5c27da3 into IsThereAnyDeal:develop Jul 20, 2024
@candela97 candela97 deleted the fix-ach-sort-locale branch July 21, 2024 19:43
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

Successfully merging this pull request may close these issues.

[BUG] Achievement Sorting By Date Unlocked Does Nothing
2 participants