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

Events longer than 1 month are not displayed #27

Open
VChet opened this issue Jan 15, 2022 · 1 comment
Open

Events longer than 1 month are not displayed #27

VChet opened this issue Jan 15, 2022 · 1 comment

Comments

@VChet
Copy link

VChet commented Jan 15, 2022

Events that start on one month and end on another are not being displayed at all. In the reproduction code there are three events, 1 day long, 1 week long and 1 month long, but only the first two are in the calendar.

Reproduction code
<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/color-calendar/dist/css/theme-basic.css" />
  <script src="https://cdn.jsdelivr.net/npm/color-calendar/dist/bundle.js"></script>
</head>
<body>
  <div id="color-calendar"></div>
  <div class="dayEvents"></div>
  <script>
    const today = new Date();
    const eventsData = [
      { start: today, end: today, name: "one day event" },
      { start: today, end: new Date(new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000)), name: "one week event" },
      { start: today, end: new Date(new Date(today.getTime() + 30 * 24 * 60 * 60 * 1000)), name: "one month event" },
    ];
    new Calendar({
      id: "#color-calendar",
      calendarSize: "large",
      eventsData,
      dateChanged: (_date, events) => {
        document.querySelector(".dayEvents").innerText = JSON.stringify(events, null, "  ");
      },
    });
  </script>
</body>
</html>

Same code on codepen.io

@razvanphp
Copy link

Duplicate of #17 and possible fix is in #18 (some cleanup needed).

@PawanKolhe can we please get you back to push this important bugfix? 😁 Thank you for this great piece of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants