I've been trying out Datepicker of JqueryMobile and found out that the week number shown in the UI is wrong. But the desktop version of the JQuery Datepicker shows the correct date.
First week of the JAN shown as 52nd week where it should be 1st week.
Has someone encountered this issue??
my code
//bind to pagecreate to automatically enhance date inputs
$( "input[type='date'], input:jqmData(type='date')", this ).each(function(){
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: false, showWeek: true, onSelect: function(dateText, inst) {
alert(dateText);}));
});
Hiya demo http://jsfiddle.net/ZuaLs/
Please try this. var week=$.datepicker.iso8601Week(new Date(dat));
jquery code
$('#datepicker').datepicker({
onSelect: function(dat,inst){
var week=$.datepicker.iso8601Week(new Date(dat));
$('#datepicker').val($.datepicker.formatDate('yy-',new Date(dat))+(week<10?'0':'')+week)
alert("Weeek number ==> " + week);
}
});