jquery - Why date format is not changed in datepicker? -




i have used jquery-ui-1.7.2 datepicker in code. want change date in 'yy-mm-dd' format. doesn't change , takes default value.

here code:

<div  id='mydate'>  <input type="text" id="monthinput" class="form-control" name="water.month"  value="${water?.month}"  />   </div> 

and jquery:

  var = new date();         var prevmonthfirstdate = new date(now.getfullyear() - (now.getmonth() > 0 ? 0 : 1), (now.getmonth() - 1 + 12) % 12, 1);         var prevmonthlastdate = new date(now.getfullyear(), now.getmonth(), 0);         $('#monthinput').datepicker({              altformat: 'yy-mm-dd',             dateformat: 'yy-mm-dd',             startdate: prevmonthfirstdate,             enddate: prevmonthlastdate         }); 

screenshot attached

what should do?

use dateformat property instead of altformat

    $('#monthinput').datepicker({          dateformat: 'yy-mm-dd'     }); 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -