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

Add the ability to add custom content to days, months, years (e.g. holidays etc.) #162

Open
divStar opened this issue Aug 8, 2022 · 1 comment

Comments

@divStar
Copy link

divStar commented Aug 8, 2022

This is a great calendar from what I can tell so far!

I am currently missing a way to show additional information per day, month and/or year. That information could be a name of a holiday, some sort of status showing something (e.g. a multi-colored line showing how much work I have tracked for that day out of the normal amount of hours, whether I were present at that day at all).

The component wouldn't have to know anything of what I mentioned. It should just offer a way to pass data (preferably a component) to any given cell (on any level - day, month or year) and offer some control over how the cell content is displayed (in order to e.g. allow vertical-align: top or the corresponding flex attributes for each cell on each level). It'd could be part of a "store", which would be taken into account.

Just an idea:

  • have e.g. the InlineCalendar accept one of each: day-, month- and year-component, which would display data
  • have e.g. the InlineCalendar include an array of data objects, that one can access e.g. per day, month or year and pass it to the display component

This way the InlineCalendar (or any other component) wouldn't need to know what it is exactly displaying in addition to the day, month or year; it'd only need to make sure, that if say the store is altered to contain another data object, it'd make the object available to the inner component it got.

{
   "date":"2022/09/12",
   "contents": {
      "events": [
         {
            "name":"some event",
            "type":"..."
         }
      ]
   }
}

(date is some date in some format, e.g. 2022/09/12 to be used as the key, contents could really be anything, but it would be supposed to be something, that the passed component, that's displayed somewhere in a day, month or year cell, understands)

Even though I am not Svelte-savvy, I think I could create a PR for this, but I thought I'd ask first.

@FluffyDiscord
Copy link

Option to pass custom component for day/month/year part would be the reason to switch to this library

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