c# - bootstrap Jquery datepicker issues -


i'm using datepicker such:

 $('#fromdate').datepicker({                 "changemonth": true,                 "changeyear": true,                 "numberofmonths": 2,                 "onclose": function(selecteddate) {                     $('#todate').datepicker("option", "mindate", selecteddate);                 }              });             $('#todate').datepicker({                 //"defaultdate": "+1w",                 "changemonth": true,                 "changeyear": true,                 "numberofmonths": 2,                 "onclose": function(selecteddate) {                     $('#fromdate').datepicker("option", "maxdate", selecteddate);                 }             }); 

i set default date in c# codebind such:

 var dt = datetime.now;         todate.value = dt.toshortdatestring();         fromdate.value = dt.toshortdatestring(); 

this displayed :

enter image description here

however, when click calendar icon, shows 6 month, third day, , anyother selection in format. i've tried no joy:

$(function() {                 $("#fromdate").datepicker({ dateformat: "dd/mm/yyyy" }).val();                 $("#todate").datepicker({ dateformat: "dd/mm/yyyy" }).val();             }); 

how change have format of dd/mm/yyyy?

simply use this:

   $("#from").datepicker({         "changemonth": true,         "changeyear": true,         "numberofmonths": 2,         dateformat:"dd/mm/yy",                   //whatever format need.         onclose: function( selecteddate ) {          } 

follow same todate

js fiddle demo


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -