viewMode bootstrap datetimepicker disable months and years

Asked

Viewed 142 times

1

I have the following code:

<div class="input-group date dtPicker @Html.GeneratePermssionID(item.IntegrationId)" style="width: 200px;" id="dateFrom" data-pl="5">                                                                                                                   
<span class="input-group-addon">De:</span>
@if (item.IntegrationExecutionStats == IntegrationExecutionStats.Running)
{
<input type="text" class="form-control dateFrom @Html.GeneratePermssionID(item.IntegrationId)" data-pl="5" placeholder="___/___/___" disabled>
}
else
{
<input type="text" class="form-control dateFrom @Html.GeneratePermssionID(item.IntegrationId)" data-pl="5" placeholder="___/___/___">
}
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>

I want to establish that the calendar shows only the days (not allowed to access month or year). I put the following script below div but does not work. what is wrong?

$("#dateFrom").datepicker( {
viewMode: "days", 
maxViewMode: "days"
});
  • Have you tried using datepicker de jquery ui? https://jqueryui.com/datepicker/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.