Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

datetime calendar : select date range in a single input field

Is there a javascript datetimepicker that can selects 2 dates in a single input field. Like: enter image description here (Screenshot taken from google-analytics)

Currently we need to use 2 form input fields to select date range.

Is there any free datetimepicker that provides this functionality?

like image 263
Satish Pandey Avatar asked Jan 16 '13 07:01

Satish Pandey


People also ask

How do you set a range in input type date?

To set and get the input type date in dd-mm-yyyy format we will use <input> type attribute. The <input> type attribute is used to define a date picker or control field. In this attribute, you can set the range from which day-month-year to which day-month-year date can be selected from.

How do I set a Datepicker range?

To set date range of one month from current date, we will use 'M' option to "+1" for maxDate and for minDate "0" So the current date becomes the value of minDate. See below jQuery code. $(document). ready(function(){ $("#txtDate").

How do I restrict dates on date picker?

You can restrict the users from selecting a date within the particular range by specifying MinDate and MaxDate properties. The default value of MinDate property is 1/1/1920 and MaxDate property is 12/31/2120 . Dates that appears outside the minimum and maximum date range will be disabled (blackout).


1 Answers

This is what you're looking for: https://github.com/dangrossman/bootstrap-daterangepicker

like image 73
Jason Raines Avatar answered Oct 13 '22 20:10

Jason Raines