Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Timeline: Fix for majorLabels showing wrong dates #3573

Merged
merged 1 commit into from
Oct 14, 2017

Conversation

knokit
Copy link
Contributor

@knokit knokit commented Oct 14, 2017

majorLabels were being rendered with wrong date (rendered date of the next step in the scale).

Screenshot of the issue: (check it live here)
timeline_majorlabels

Changes:

  • TimeStep.getCurrent() returns a clone of current date, in order to avoid accidental modifications outside of TimeStep class
  • Removed some unused variables from TimeAxis._repaintLabels() and render majorLabels with the correct date

@knokit knokit changed the title [Timeline] Fix for majorLabels showing wrong dates Timeline: Fix for majorLabels showing wrong dates Oct 14, 2017
@yotamberk
Copy link
Contributor

Thanks for the PR but I don't see what the bug is. Where do you see the wrong date?

@knokit
Copy link
Contributor Author

knokit commented Oct 14, 2017

Using the "D MMM YYYY" format for the majorLabels, you can see that they show a different dates than the ones showed in the respective minorLabels, as visible in the screenshot above. Is this the correct behaviour?

Example:
minorLabel shows 1 (of April 2018), while majorLabel shows 6 Apr 2018 when it should be "1 Apr 2018"

@yotamberk
Copy link
Contributor

Uh ha! Ok I see it now.
Well done!

Copy link
Contributor

@yotamberk yotamberk left a comment

Choose a reason for hiding this comment

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

Nice job!

@yotamberk yotamberk merged commit dfe9c40 into almende:develop Oct 14, 2017
mojoaxel pushed a commit to visjs/vis_original that referenced this pull request Jun 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants