I'm using bootstrap daterangepicker how to predefine date range as default?

Syed Nizamudeen picture Syed Nizamudeen · Nov 20, 2014 · Viewed 16.8k times · Source

Help me to set Specific Date Range as Default by Using bootstrap daterangepicker(Text Input)

<input type="text" class="form-control pull-right" id="trvlreqprd" name="trvlreqprd" placeholder="Click here to Choose Date">

JS:

$('#trvlreqprd').daterangepicker();

I need the text filed to be filled with predefined date. (For Example: 2014/11/05 - 2014/11/12)

Bootstrap Detail


filename: bootstrap-datepicker.js

Repo: https://github.com/eternicode/bootstrap-datepicker/

Answer

Syed Nizamudeen picture Syed Nizamudeen · Nov 21, 2014

I just tried adding predefined dates to value attribute. Its working as i wanted. Thanks Guys for Helping me.

<input type="text" class="form-control pull-right" id="trvlreqprd" name="trvlreqprd" value="<?php echo "2014/11/05 - 2014/11/12"; ?>" placeholder="Click here to Choose Date">