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

Allow day scale show week division #1420

Merged

Conversation

dennissterzenbach
Copy link
Contributor

This PR enables you to display a time axis with day scale and divide it into weeks with majorLabels showing the week number. Simply set showWeekScale and the majorLabels will switch between monthly scale and week scale, keeping the overall division by days.

I would expect that setting these options:

{
  locale: 'de',
  timeAxis: {
    scale: 'day',
    step: 1
  },
  showWeekScale: true,
  format: {
    minorLabels: {day: 'DD.MM'},
    majorLabels: {day: 'w'}
  }
}

lead to the following result:

... | 18                                                           | 19 ...
... | 02.05. | 03.05. | 04.05. | 05.05. | 06.05. | 07.05. | 08.05. | 09.05. ...

However, the result before this PR was instead:

... | 17     | 18                                                           
... | 01.05. | 02.05. | 03.05. | 04.05. | 05.05. | 06.05. | 07.05. | 08.05. | 09.05. ...

tursics
tursics previously approved these changes May 12, 2022
Copy link

@tursics tursics left a comment

Choose a reason for hiding this comment

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

Looks good to me

@mojoaxel mojoaxel force-pushed the allow-day-scale-show-week-division branch from 528bf99 to a59dd13 Compare July 10, 2022 19:08
mojoaxel
mojoaxel previously approved these changes Jul 10, 2022
Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM!

Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

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

Manually merged with fbdada2

@mojoaxel mojoaxel merged commit 6315f3c into visjs:master Jul 10, 2022
@vis-bot
Copy link
Collaborator

vis-bot commented Jul 10, 2022

🎉 This PR is included in version 7.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mojoaxel
Copy link
Member

@dennissterzenbach Thank you very much for this PR! 🎉
Sorry that it was merged soooo late, but I guess we have to consider this project unmaintained at the moment 😞

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.

4 participants