-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JavaScript Error: Cannot Parse Date Format on Version 1.21.11 During Page Change in Milestones #32291
Comments
If you cannot reproduce this on the demo site with the same repository or page, that commonly means this has been resolved by Gitea new stable versions. So that maybe you can try upgrade to v1.22 |
Please run: SELECT *
FROM "milestone" |
I'm having the exact same issue. The output of
I only have one milestone. I'm on v1.22. |
Then it must not be the milestone deadline, probably another timestamp on that page. |
How to reproduce it? |
But it is related to the milestone deadline. You see, Some guesses: from API? from some data migration? or some frontend behavior (JS uses millisecond)? |
cc @silverwind |
After reading more context, I think the real problem is the bad design of "Deadline", which uses "9999-12-31". The bad design triggers the frontend bug (say, frontend code is not right either). A complete fix should start from refactoring the "Deadline" field of the Milestone model. A quick fix could only bypass some edge cases. |
Maybe we can use |
The year "9999" in web/api was introduced in year 2014 (it doesn't seem reasonable), at the moment there is no migration using such value. And the worst thing is, when |
|
This bug also triggers when you migrating server to another timezone, eg. Gmt+3 to gmt+5 |
Use zero instead of 9999-12-31 for deadline Fix #32291 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
Description:
During the page change in the Milestones section, a JavaScript error is encountered that states:
This error is thrown from the file webcomponents.js at the following URL:
https://10.11.20.95:3000/assets/js/webcomponents.js?v=1.21.11 at line 1,55713.
Steps to Reproduce:
Expected Behavior:
The page should change without any JavaScript errors.
Actual Behavior:
A parsing error occurs, but the milestone list is loaded correctly.
Recommendation:
Check the date formatting in the data being passed to the JavaScript function. Ensure it conforms to a valid date format that can be parsed successfully.
Note:
Open the browser console for more details on the error message and stack trace.
Gitea Version
1.21.11
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
Git Version
No response
Operating System
Ubuntu
How are you running Gitea?
The Gitea is running on Ubuntu 20.04.3 as a systemd service.
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: