3

I'm trying to select date in mobile version website but it takes date from datepicker in form of mm/dd/yyyy but i want it in dd/mm/yyyy

I also tried it by changing in "jquery.ui.datepicker.mobile.js" file

$( ".ui-page" ).live( "pagecreate", function(){     
   $( "input[type='date'], input[data-type='date']" ).each(function(){
      $(this).after($("<div />").datepicker({ altField: "#" + $(this).attr("id"),
                           showOtherMonths: true, dateFormat: "dd/mm/yy" }));
   }); 
});

IN my JSP page I write this line

<input type="date" id="frmdatepicker" name="frmDateFilter" 
                                          value="<%= frmDateFilter %>"/>

but still not working. please help me..

1 Answer 1

2

Working example: http://jsfiddle.net/Gajotres/ZenxF/

This is how you do it:

$(document).on('pageinit', '[data-role="page"]', function(){ 
   $( "input[type='date']" ).each(function(){
      $(this).datepicker({ altField: "#" + $(this).attr("id"), showOtherMonths: true, dateFormat: "dd/mm/yy" });
   });        
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.