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 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.
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 correspondingflex
attributes for each cell on each level). It'd could be part of a "store", which would be taken into account.Just an idea:
InlineCalendar
accept one of each: day-, month- and year-component, which would display dataInlineCalendar
include an array of data objects, that one can access e.g. per day, month or year and pass it to the display componentThis 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
is some date in some format, e.g. 2022/09/12 to be used as thekey
,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.