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

disable past days and show current days +15days #131

Closed ramakanth0011 closed 3 years ago

ramakanth0011 commented 3 years ago

Sir, I am using "basicExample" . I want to disable past days and show on current date and 15days from current days. I tried doing my self but couldn't able make it.

jonthornton commented 3 years ago

You'll need to configure that with your datepicker; it actually doesn't involve Datepair.js. If you're using Bootstrap Datepicker, it'd look something like this:

const in15days = new Date();
in15days.setDate(in15days.getDate() + 15);

$('#basicExample .date').datepicker({
  'format': 'm/d/yyyy',
  'autoclose': true,
  'startDate': new Date(),
  'endDate': in15days
});
ramakanth0011 commented 3 years ago

thank you soo much sir. really apricate your work and support.... one more think i want to add in the start end and end time. like suppose current time is 3.48pm . i want the start time start from 4:00 pm. can u please help me with this... thanks alot sir