Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shapes and annotations do not handle Date objects or strings with time zones

See original GitHub issue

At the moment (version 1.25.1), data traces can handle Date objects, which will then be displayed with what seems to be the browser’s timezone settings. For example, date = new Date("2017-03-30T00:00:00.000Z") used on the X-axis in a trace, with a browser in the UTC+1 timezone will be displayed as “Mar 30, 2017, 01:00”, which is indeed correct.

However, that same date object cannot be used for x0/x1 in a shape on the same object.

When using date.toISOString() instead (both for data and shapes), the timezone indicator (e.g. Z) at the end of the string is ignored and the string is considered to be within the local time zone.

Here is a jsfiddle to demonstrate the problem:


Effectively, the problem is two-fold (and might lead to two separate issues):

  • It would be good if shapes and annotations also supported date objects.
  • ISO-8601 date parsing should take into account the Z (or generally +xxxx or +xx:xx) timezone indicator before building its internal UTC representation. This is certainly related to #1003 (and subsequent work).

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

brian428commented, Oct 2, 2018

Any progress on this? It seems like some sort of time zone support (or at least the ability to specify a time format function or string) is still badly needed.

Yevgnencommented, Mar 8, 2019

Any news?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Using Instant, LocalDateTime and ZonedDateTime ...
Your JSON input is representing a moment, a specific point on the timeline. A LocalDateTime cannot represent a moment. Read the class doc....
Read more >
A practical example for Handling Time Zone conversion in ...
This article mainly focused on checking the ability to handle the time zones with different java date/time data structures.
Read more >
Docs timeZone
A time zone is a region of the world that serves as a context for displaying dates. It affects a Calendar instance in...
Read more >
JsonFormat (Jackson-annotations 2.11.4 API) -
Value that indicates that default TimeZone (from deserialization or serialization context) should be used: annotation does not define value to use.
Read more >
Date and time formats are specified by date and time pattern strings. ... SimpleDateFormat does not deal with the localization of text other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found