Skip to content

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

@ddb4github

Description

@ddb4github

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourenhancementGeneral tag for an enhancementimport/exportRelated to Import and Export of Template and PackagesresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions