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

Feature request: Allow render of all time slot labels #329

Open
danyalejandro opened this issue Sep 17, 2024 · 1 comment
Open

Feature request: Allow render of all time slot labels #329

danyalejandro opened this issue Sep 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@danyalejandro
Copy link

First, thank you for this wonderful library.

We are trying to build a calendar with time slots as in this example:

image

Note how there's a time slot with a label every 15 minutes (6:30 am, 6:45 am, 7:00 am, and so on).

I tried reproducing this with slotDuration: '00:15:00' but the library will skip printing the time label at odd rows, which in practice, will only print the label every 30 minutes. using slotDuration: '00:07:30' won't work as it will generate additional rows I don't want.

I believe this odd-even print logic is caused by the condition in packages/time-grid/src/Section.svelte:15:

<time class="{$theme.time}" datetime="{time[0]}" use:setContent={time[2] ? time[1] : ''}></time>

If the time slot label was printed for every row, it would satisfy my requirement (after some CSS fiddling). Could you please print the time slot label for every row, and hide it using CSS (i.e. using :nth-child(odd) and :nth-child(even) classes)? Or perhaps make it a configuration flag?

I'm open to contributing a PR if you're too busy to implement this.

@vkurko
Copy link
Owner

vkurko commented Sep 18, 2024

Good idea. I will implement this later.

@vkurko vkurko added the enhancement New feature or request label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants