jQuery datetimepicker option minDateTime bug?

I set controlType as 'select', and set a minDateTime as "2015/03/04 20:15" for #datetimepicker, when I click it, For each hour of the day can not select the number of minutes less than 15.

jQuery datetimepicker option minDateTime bug? or my way is wrong?

$("#datetimepicker").datetimepicker({
  minDateTime: new Date("2015/03/04 20:15"),
  controlType: 'select'
});
/* css for timepicker */

.ui-timepicker-div .ui-widget-header {
  margin-bottom: 8px;
}

.ui-timepicker-div dl {
  text-align: left;
}

.ui-timepicker-div dl dt {
  float: left;
  clear: left;
  padding: 0 0 0 5px;
}

.ui-timepicker-div dl dd {
  margin: 0 10px 10px 45%;
}

.ui-timepicker-div td {
  font-size: 90%;
}

.ui-tpicker-grid-label {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
}

.ui-timepicker-rtl {
  direction: rtl;
}

.ui-timepicker-rtl dl {
  text-align: right;
  padding: 0 5px 0 0;
}

.ui-timepicker-rtl dl dt {
  float: right;
  clear: right;
}

.ui-timepicker-rtl dl dd {
  margin: 0 45% 10px 10px;
}
<script src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" /> Date: <input type="text" id="datetimepicker" />

Upvotes: 1

Views: 2692

Answers (2)

JazZ
JazZ

Reputation: 4579

Maybe try this syntaxe.

$( "#datetimepicker" ).datetimepicker({
    minDate: new Date(),
    controlType:'select'
});

Upvotes: 1

ScottyB
ScottyB

Reputation: 2487

I would look at the way you're creating the Date (http://www.w3schools.com/js/js_dates.asp)

Also, try adding the 'minDate' option in addition to the 'minDateTime' option, using the same (correct) date value.

Upvotes: 0

Related Questions