-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
fix(chart): Fix bugs ‘Older Dates with Year 1937 or less in charts is showing as NAN’ #24696
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't speak to the code but appreciate you working on this! |
@@ -423,7 +423,11 @@ export class TableRenderer extends React.Component { | |||
dateFormatters && | |||
dateFormatters[attrName] && | |||
typeof dateFormatters[attrName] === 'function' | |||
? dateFormatters[attrName](colKey[attrIdx]) | |||
? dateFormatters[attrName]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wangkun723 it doesn't look safe to custom logic in each chart. The logic should be within dateFormatter.
I also found this PR from @villebro which seems cover this case too.
Could you try with the above hotfix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thank you for your guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justinpark Hello, I have made the code changes and placed the logic inside the TimeFormatter class. please review it again
I can't replicate #24561 on 3.0.0rc2, following the same steps I use to reproduce the behavior on 2.1.0. Maybe closed by the PR that @justinpark flagged as related, #23339 ? (though #24561 wasn't Trino-specific). @wangkun723 are you able to try out 3.0.0rc2 release candidate version or the |
|
It seems that the issue this PR was attempting to solve is no longer an issue in current versions. That's probably how this slipped under the radar for so long... it's just not needed nowadays. If anyone is still experience the bug or sees a need for this PR, just say the word, so we can reopen it and see if it passes current CI. Thanks for the contribution! |
SUMMARY
I made modifications in two places to try to solve the problem.The problem may be that the time data transmitted by the backend to the front-end is a timestamp, but when the length of a number timestamp number is greater than 12 (excluding symbols) when the time is less than 1937, the front-end JSON conversion will become 'BigNumber' and cannot be directly converted into formatted form.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION