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

Modify the date selector to use the session timezone #15783

Merged
merged 6 commits into from
Feb 21, 2024

Conversation

eskyuu
Copy link
Contributor

@eskyuu eskyuu commented Jan 31, 2024

Change the date selector to use the timezone defined in the session.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@eskyuu eskyuu changed the title Modified the date selector to use the session timezone WIP - Modified the date selector to use the session timezone Jan 31, 2024
@eskyuu
Copy link
Contributor Author

eskyuu commented Jan 31, 2024

I need to alter submitCustomRange() in html/js/librenms.js to also be timezone aware.

@eskyuu eskyuu changed the title WIP - Modified the date selector to use the session timezone Modify the date selector to use the session timezone Jan 31, 2024
@eskyuu
Copy link
Contributor Author

eskyuu commented Jan 31, 2024

This version works for me

@dlangille
Copy link
Contributor

dlangille commented Feb 1, 2024

I'll test this. I started that yesterday, but hit problems with patching - those problems are not for @eskyuu to resolve.

@dlangille
Copy link
Contributor

dlangille commented Feb 1, 2024

See:

@dlangille
Copy link
Contributor

I finally got the patch to build here (not the fault of your patch) - by "Modify the date selector to use the session timezone" - should I be seeing local time (based on my laptop) or the Timezone specified in /preferences (which I have set to UTC)? I ask because I'm seeing local time in the date picker and on the graph legends.

@eskyuu
Copy link
Contributor Author

eskyuu commented Feb 3, 2024 via email

@dlangille
Copy link
Contributor

Success! This is great, thank you.

After changing to local time and back to UTC and reloading the page with the graphs, I have UTC in the date picker and on the graph legends.

NOTE: When I select a date range via the date picker and click on Update:

  • the graph starts at the time the select
  • the graph ends at current time
  • the To field of the date picker is current time

@laf
Copy link
Member

laf commented Feb 17, 2024

Thanks @eskyuu, looks and works great.

Would you mind just fixing the style issues (I know you didn't change that part of the code) then we can merge

@eskyuu
Copy link
Contributor Author

eskyuu commented Feb 18, 2024

No worries - the style should be fixed now.

Copy link
Member

@electrocret electrocret left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@electrocret electrocret merged commit 3d94c53 into librenms:master Feb 21, 2024
8 checks passed
@librenms-bot
Copy link

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/24-2-0-changelog/23721/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants