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

Problem with setting date to array #285

Closed
bracke opened this issue Dec 31, 2018 · 2 comments
Closed

Problem with setting date to array #285

bracke opened this issue Dec 31, 2018 · 2 comments

Comments

@bracke
Copy link

bracke commented Dec 31, 2018

Hi

I'm using emner-flatpickr in range mode and want to supply two values at start values, but I get an exception:

"Assertion Failed: {{ember-flatpickr}} requires a date to be passed as the value for flatpickr."

{{ember-flatpickr
locale="da"
mode="range"
nextArrow=">"
date=['01-01-2011', '12-12-2016']
dateFormat="d-m-Y"
altFormat="Y-m-d"
minDate=minDate
onChange=(action "setDateRange")
placeholder="Vælg en periode..."
prevArrow="<"
weekNumbers=true
classNames="form-control"
}}

@RobbieTheWagner
Copy link
Owner

I don't think the example you provided is valid handlebars.

date=['01-01-2011', '12-12-2016'] would not work. You would have to setup an array in your JS and pass it down.

@bracke
Copy link
Author

bracke commented Jan 1, 2019

I have tried with an array in js, but it seemed to make flatpickr ignore the mode=range setting so it only took the first value.

But I found out what was wrong - it was the mindate - it was later than one of the values in the range!
I adjusted and now it works :-)

Thanks for responding.

Happy New Year.

@bracke bracke closed this as completed Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants