How can I refresh aui datepickers min/max value?

Deleted user August 24, 2018

If I use constructor to refresh control I am getting in some cases two calendar popups. If I use refresh method of datepicker onSelect event is lost.

I am missing method setMin/Max date to change this value later dinamicaly.

Best regards

 

1 answer

1 accepted

0 votes
Answer accepted
Daz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2018

Hi simon,

This *should* be straightforward -- the intent is that if you change the value of the `min` or `max` attributes on the input field, the calendar should automatically update. However, this is not the case, because there is a bug in AUI's datepicker implementation. I have raised an issue to track this bug: https://ecosystem.atlassian.net/browse/AUI-4956

As it stands today, it's not easy to do this dynamically. You would need to rely on internal implementation details of AUI's date picker component, which may change in future versions.

I have crafted a hack to demonstrate how you would lean on the internal implementation details. As you can see, it's not pretty... but it gets the job done: https://codepen.io/chrisdarroch/pen/NEQWVG

Hope that helps!

Daz

Deleted user December 6, 2018

Hi Day

Thank you for reply. I'll check and  probably replace my code with your. At the moment I am deleting and inserting datepicker element with new min/max values. I hope that that bug will be resolved soon :-)

Simon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events