Datapicker ONLY Year and Month stopping in the month

Asked

Viewed 799 times

1

I’m developing a solution that needs to optimize the time to feed the system with dates, which is often very repetitive.

PROBLEM: One of the fields that inserts date, I just want the year and the month. I formatted it to receive year and month, but the user needs to arrive until the day to receive the input year and month, and this is not necessary. Theoretically it could solve this with the attributes "minViewMode" and "maxViewMode" of the datapicker, but the same starts in the window "month" but does not recognize the "maxViewMode: 1" to stop there, extend until the selection of the day.

$('#database').datepicker({
    language: 'pt-BR',
    startView: 1,
    minViewMode: 1,
    maxViewMode: 1,
    format: 'MM/yyyy',
    /* 
        //beforeShowDay:unavailable
        //beforeShowDay: onlyPastdays
        autoclose: true,
        minViewMode: 1,
        format: 'mm/yyyy' */
});
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<div class="input-group col-lg-12">
  <span class="input-group-addon botao-label">Data-Base:</span>
  <input type="text" class="form-control" id="database" />
  <span class="input-group-addon">
<i class="glyphicon glyphicon-calendar"></i>
  </span>
</div>

  • I think this might help you, I believe I’m on my way! http://jsfiddle.net/DBpJe/13475/ Abs!!

No answers

Browser other questions tagged

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