Skip to content

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

@divStar

Description

@divStar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions