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

Is there a weekly view? #394

Open
astromaviation opened this issue May 8, 2024 · 2 comments
Open

Is there a weekly view? #394

astromaviation opened this issue May 8, 2024 · 2 comments
Labels
👨‍🏫 Help wanted Extra attention is needed ❓ Question Further information is requested

Comments

@astromaviation
Copy link

image

@astromaviation astromaviation added ❓ Question Further information is requested 👨‍🏫 Help wanted Extra attention is needed labels May 8, 2024
@neuronetio
Copy link
Owner

You can use calendar levels to achieve that.

There is an example configuration with week but you need to specify chart.time.zoom property that is higher than day and lower or equal to week zoomTo property.
Zoom is the way to tell GSTC to change current view for example from hour view to month or week view.

Example week:

{
    zoomTo: 22,
    period: "day",
    main: true,
    periodIncrement: 1,
    classNames: ["gstc-date-vertical"],
    format({ timeStart, className, vido }) {
      return vido.html`<div class="${className}-content gstc-date-top">${timeStart.format(
        "DD"
      )}</div><div class="${className}-content gstc-date-extra-small">${timeStart.format("ddd")}</div>`;
    },
  },
{
    zoomTo: 23,
    period: "week",
    main: true,
    periodIncrement: 1,
    format({ timeStart, timeEnd, className, vido }) {
      return vido.html`<div class="${className}-content gstc-date-top">${timeStart.format("DD")} - ${timeEnd.format(
        "DD"
      )}</div><div class="${className}-content gstc-date-small gstc-date-thin">${timeStart.format(
        "ddd"
      )} - ${timeEnd.format("dd")}</div>`;
    },
  },

@astromaviation
Copy link
Author

thanks, i keep trying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👨‍🏫 Help wanted Extra attention is needed ❓ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants