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

Interval States #166

Open
hugoaboud opened this issue May 7, 2023 · 2 comments
Open

Interval States #166

hugoaboud opened this issue May 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hugoaboud
Copy link

I want to use the Week/Day view as a scheduling tool, so I need the intervals to have states.

I've implemented a sample at the interval-states branch of my fork:
https://github.com/hugoaboud/qalendar/tree/interval-states

It adds a intervalStates prop to <Qalendar>, which is a list defining which intervals should be customized:

intervalStates: [
    {
      date: '2023-05-05',
      interval: 1,
      hidden: true
    },
    {
      date: '2023-05-04',
      interval: 3,
      color: '#900',
      disabled: true
    }
] as dayIntervalsStateType[],

So it appears like that:
image

I haven't implemented any tests yet, so I can evaluate your interest before.

It also implements a highlight on hover and click for intervals.

@tomosterlund
Copy link
Owner

This is a great idea! Feel free to open a pull request. Though I was sloppy sometimes, the goal is to have test coverage of every feature of the component. So if possible, try and implement unit & cypress tests, but also I can help you with this if you want.

Also a hot tip/request from my side: if opening a pull request, be sure to make as few code changes as possible to make the feature happen. There is a major refactoring in progress for v3, and for every file changed until then, I will have a merge conflict to solve later on.

@tomosterlund tomosterlund added the enhancement New feature or request label May 8, 2023
@hugoaboud
Copy link
Author

Nice! I figured a refactor might be on the way and tried to be careful with changes.
I'll review it as soon as possible and open a PR :)

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