jonthornton / Datepair.js

A javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar.
https://www.jonthornton.com/Datepair.js
358 stars 87 forks source link

How do I make it not possible to select dates before the current one? #107

Closed jonathanoh1 closed 6 years ago

jonathanoh1 commented 6 years ago

How do I make it not possible to select dates before the current one?

im using this : " $('#start_date').on('change', function() { var start_date = $('#start_date').datepicker('getDate'); var now = new Date(); if (start_date < new Date()) { console.log(start_date, now); } }); " but I hope there is a function that does it in a simple option in $ ('# dateEvent .date'). datepicker ({/ here / });

thanks

jonthornton commented 6 years ago

I'm not sure I understand the functionality you're trying to achieve. Can you give an example?

jonathanoh1 commented 6 years ago

in the datepicker of the month, if today is March 8, I want it impossible to select March 7 or days before, is there an option to disable those days?

jonthornton commented 6 years ago

No, you'll need to code that up manually.