Opened 5 years ago

Closed 5 years ago

#9788 closed bug (invalid)

Date picker swapping month and day for Canada users

Reported by: gudikavitha Owned by: gudikavitha
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

Hi, we are using datepicker withd efault format mm/dd/yy, for some Canada users it's flipping as dd/mm/yy. Not sure what's causing this to happen. Since they are home computers, hard to track the problem. Code: <pre> $(document).ready(function() {

var today = new Date(), minutes = today.getMinutes(), previousdate = today.getTime(), previousdate = previousdate - (today.getHours() * 60 * 60 * 1000) - (today.getMinutes() * 60 * 1000) - (today.getSeconds() * 1000), onejan = new Date(today.getFullYear(),0,1);

var minDate = today; var hours = minDate.getHours(); if(minDate.getDay()>=1){

if(hours >= 7 && minutes > 0){

minDate = new Date(minDate.setDate(minDate.getDate() + 7));

}

}

Date.prototype.getWeek = function () { return $.datepicker.iso8601Week(this); }

var pickerOpts = {

showOn: "button", buttonImage: './images/calendar.gif', buttonImageOnly: true, showWeek:true, minDate: today, beforeShowDay: function(date) {

if(date.getWeek()>=1 && date.getWeek()<=23){

return [(date.getDay() == 4), ""];

}else{

return [false,""];

}

}

};

var cal = {

showOn: "button", buttonImage: './images/calendar.gif', buttonImageOnly: true

};

var minDefferalDate = new Date(); var minutesDeff = minDefferalDate.getMinutes(); var hoursDeff = minDefferalDate.getHours(); if(minDefferalDate.getDay()==5){ if(hoursDeff >= 7 && minutesDeff > 17 ){

if(hoursDeff > 5){ minDefferalDate = new Date(minDefferalDate.setDate(minDefferalDate.getDate() + 10));

} } var pickerMon = {

showOn: "button", buttonImage: './images/calendar.gif', buttonImageOnly: true, minDate: minDefferalDate, beforeShowDay: function(date) { return [(date.getDay() == 1), ""]; }

maxDate: calendar.newDate(date.getYear()+1, 8, 1),

};

$("#date").datepicker(pickerOpts); $("#date1").datepicker(pickerMon); $("#date2").datepicker(pickerMon); $("#date3").datepicker(pickerMon); $("#date4").datepicker(pickerMon); $("#date5").datepicker(pickerMon); $('#datePicker').datepicker({ minDate: 4,beforeShowDay: $.datepicker.noWeekends }); $("#startDate").datepicker(cal); $("#endDate").datepicker(cal); $('#startDate').attr('readonly', true); $('#endDate').attr('readonly', true);

$(".listItr td:not(:LAST-CHILD)").css({'border' :'1px solid black'}); $("table.gridtable th:not(:LAST-CHILD)").css({ 'border-width': '1px', 'padding': '8px', 'border-style': 'solid', 'border-color': '#666666',

'background-color': '#dedede'});

/*

  • To allow only numeric values in s:textfield */

$('#cid').keypress(function(e) {

var a = []; var k = e.which;

for (i = 48; i < 58; i++)

a.push(i);

if (!($.inArray(k,a)>=0))

e.preventDefault();

});

}); </pre>

Change History (2)

comment:1 Changed 5 years ago by Scott González

Owner: set to gudikavitha
Status: newpending

We need a reduced test case that reliably reproduces the problem. Please read the instructions in the red box.

comment:2 Changed 5 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.