Freitz
Freitz

Reputation: 198

How to add days to start date of the Kendo UI DatePicker?

I have already hidden the past date. But I would like to set the start date from today + 2 days.

<input id="startDate" style="width:150px;"/>

<script>

  var puffer = 2;

  $("#startDate").kendoDatePicker({
    format: "dd/MM/yyyy",
    min: new Date() + puffer
});

Upvotes: 1

Views: 2870

Answers (1)

Freitz
Freitz

Reputation: 198

I found a solution:

var targetDate = new Date();
var addDays = 14;
var newDate = kendo.date.addDays(targetDate, addDays);

$("#picker").kendoDatePicker({
  format: "dd/MM/yyyy",
  disableDates: ["su"],
  min: newDate
});

http://dojo.telerik.com/IxUCabiL/2

Upvotes: 3

Related Questions