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

Set CSS class for date-one and date-two #25

Closed
kleusch opened this issue Jun 5, 2018 · 2 comments
Closed

Set CSS class for date-one and date-two #25

kleusch opened this issue Jun 5, 2018 · 2 comments
Labels
good first issue Good for newcomers

Comments

@kleusch
Copy link

kleusch commented Jun 5, 2018

Could you give us a CSS classes based on the current state?

E.g.
Nothing selected - no class
First date selected - class "date-one-selected"
Second date selected - class "date-two-selected"

I need this for hover state. When nothing (or all) is selected, the hover state should be another than when only the first date is selected.

For the hover effects we could set in wrapper class:
wrapperClasses() { return { 'asd__wrapper--datepicker-open': this.showDatepicker, 'asd__wrapper--full-screen': this.showFullscreen, 'asd__wrapper--inline': this.inline, 'asd__wrapper--selected-date-one': this.selectedDate1, 'asd__wrapper--selected-date-two': this.selectedDate2, }
Then I could set the hover styles on --selected class according to wrapper --selected-date-one or two.

And for default view without hover directly in day
:class="{ 'asd__day--enabled': dayNumber !== 0, 'asd__day--empty': dayNumber === 0, 'asd__day--disabled': isDisabled(fullDate), 'asd__day--selected': selectedDate1 === fullDate || selectedDate2 === fullDate, 'asd__day--selected-date-one': selectedDate1, 'asd__day--selected-date-two': selectedDate2, 'asd__day--in-range': isInRange(fullDate) }"
Then I could give the selected first and second date individual looks.

@MikaelEdebro
Copy link
Owner

Sounds like a good idea! If you have time, please submit a PR. Otherwise I can probably have a look at it in the near future.

@MikaelEdebro MikaelEdebro added the good first issue Good for newcomers label Jun 15, 2018
@MikaelEdebro
Copy link
Owner

MikaelEdebro commented Jul 23, 2018

Fixed in #42

@MikaelEdebro MikaelEdebro reopened this Jul 23, 2018
MikaelEdebro added a commit that referenced this issue Jul 23, 2018
Set classes for selected dates (dateOne & dateTwo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants