SOLVED

Kalendae date picker setting a max future date

Go to solution
WIlliam_Franks
Level 1

Kalendae date picker setting a max future date

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

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Kalendae date picker setting a max future date

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.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Kalendae date picker setting a max future date

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.

WIlliam_Franks
Level 1

Re: Kalendae date picker setting a max future date

thanks very much, amazing work Sanford!