Kalendae date picker setting a max future date | Community
Skip to main content
Adobe Employee
December 2, 2020
Solved

Kalendae date picker setting a max future date

  • December 2, 2020
  • 1 reply
  • 2212 views

Hi Community;

 

So i'm trying to use a custom date picker as recommended in other threads on this forum, see sample code:

 

<link rel="stylesheet" href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/250687/kalendae.css" /> <script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/250687/kalendae.standalone.min.js"></script> <script type="text/javascript"> MktoForms2.whenReady(function(form) { // now bind calendar widget var kal = new Kalendae.Input("SpecialDate", { months: 2, format: "YYYY-MM-DD", direction: "future" }); }); </script>

Which for the most part is fantastic, it forces a future date and looks good as part of the page.

What i really need to do is to add a maximum date, for instance i want someone to select a date of the next 12 week period...... i've looked through the Kalendae javascript and can't see any options for this but thought i'd throw it out to the community to see if anyone has achieved this.

Thanks

William

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

A later version of Kalendae introduced endDate (you should be loading Kalendae from an official CDN btw).

 

endDate accepts a Moment object, so you can easily add weeks to it as demoed here.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
December 2, 2020

A later version of Kalendae introduced endDate (you should be loading Kalendae from an official CDN btw).

 

endDate accepts a Moment object, so you can easily add weeks to it as demoed here.

Adobe Employee
December 2, 2020

thanks very much, amazing work Sanford!