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

feat: updated the date time to support timezone #2820

Closed

Conversation

Chandru-HM
Copy link
Contributor

@Chandru-HM Chandru-HM commented May 21, 2024

This PR is for ticket #2663 and added the timezone support for the date and time in xy-plot, KPI, and resource explorer

Verifying Changes

changes are not changing anything, date-time values are now adjusted to the timezone.

Legal

This project is available under the Apache 2.0 License.

@Chandru-HM Chandru-HM force-pushed the feat/timezone-support-update branch from ee5a409 to 8c90912 Compare May 22, 2024 06:07
@Chandru-HM Chandru-HM force-pushed the feat/timezone-support-update branch 7 times, most recently from 73df502 to e62b70b Compare May 22, 2024 13:20
@Chandru-HM Chandru-HM force-pushed the feat/timezone-support-update branch from e62b70b to dbbbdd6 Compare May 29, 2024 14:59
initialTrendCursorDateString
.split('\n')
.join('T')
.replace(/(\d+)\/(\d+)\/(\d+)/, '$3-$2-$1')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the date-fns library not support this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supports. updated.

return (
<DateTime
dateTime={
Number(round(latestValueTime, significantDigits)) * 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're rounding the date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.

return (
<div className='base-chart-legend-tc-header-container'>
<div>
<span>{date.toLocaleDateString()}</span>
<span>{dateTime.split(' ')[0]}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ca we use the date-fns formatter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, Done

@Chandru-HM Chandru-HM force-pushed the feat/timezone-support-update branch from dbbbdd6 to 5bf6c31 Compare May 30, 2024 07:28
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.

4 participants