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

CSV export can show NaN for date if TimeZone does not match system #3945

Closed
ddb4github opened this issue Nov 24, 2020 · 3 comments
Closed

CSV export can show NaN for date if TimeZone does not match system #3945

ddb4github opened this issue Nov 24, 2020 · 3 comments
Labels
bug Undesired behaviour enhancement General tag for an enhancement import/export Related to Import and Export of Template and Packages resolved A fixed issue
Milestone

Comments

@ddb4github
Copy link
Contributor

ddb4github commented Nov 24, 2020

Describe the bug

Graph CSV export all data as NaA with wrong date range if browser timezone is different with web server

To Reproduce

  1. Configure web server timezone as EST(-05:00), Browser side timezone is CST(+08:00)
  2. Create a new graph, ensure its valid data timerange is less than 13 hours
  3. Access Graphs-->Preview
  4. Select "Last 4 Hours"
  5. Compare params in href of "csv export", and timespans
    layout.js -->getTimestampFromDate() convert timespan date1/date2 to timestamp with browser local timezone
  6. Click "csv export" icon, and check csv file
"Start Date","2020-11-23 10:37:00"
"End Date","2020-11-23 14:37:00"
.......
"2020-11-23 15:04:00","NaN","NaN"

Screenshots

image

Additional context

Maybe, global_session.php can output web server timezone info as JS variables

@ddb4github ddb4github added bug Undesired behaviour unverified Some days we don't have a clue labels Nov 24, 2020
@ddb4github ddb4github changed the title Graph CSV export with wrong date range if browser timezone is different with web server Graph CSV export NaN with wrong date range if browser timezone is different with web server Nov 24, 2020
@TheWitness
Copy link
Member

Have you considered a pull request for this @ddb4github?

@TheWitness TheWitness added enhancement General tag for an enhancement and removed bug Undesired behaviour unverified Some days we don't have a clue labels Dec 15, 2020
@TheWitness TheWitness added the import/export Related to Import and Export of Template and Packages label Jan 4, 2021
TheWitness added a commit that referenced this issue Jan 5, 2021
* Graph CSV export NaN with wrong date range if browser timezone is different with web server
* Data Collectors and Data Profiles Filter Sub-Panel Go buttons not working as expected
@TheWitness TheWitness added the bug Undesired behaviour label Jan 5, 2021
@TheWitness TheWitness added this to the v1.2.17 milestone Jan 5, 2021
@TheWitness
Copy link
Member

Resolved @ddb4github. Please verify.

TheWitness added a commit that referenced this issue Jan 6, 2021
- Graph CSV export NaN with wrong date range if browser timezone is different with web server
- This will ensure that the times in the browser match the backend too.
@TheWitness
Copy link
Member

@ddb4github, based upon your comments, I have reworked this changes a little to ensure that all timestamps in the web site align with the browser as well. Please validate and provide feedback. This does not change the CLI's.

@TheWitness TheWitness added the resolved A fixed issue label Jan 12, 2021
@netniV netniV changed the title Graph CSV export NaN with wrong date range if browser timezone is different with web server CSV export can show NaN for date if TimeZone does not match system Apr 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour enhancement General tag for an enhancement import/export Related to Import and Export of Template and Packages resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants