Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rafael Lima on Oct 01, 2009 10:00
open dhtmlx forum
Dhtmlxcalendar - Problem choosing October 18th 2009

Hi, I have a problem choosing October 18th 2009, it returns October 17th 2009 when I call the getFormatedDate() function.

It happens with the samples too in this link, for example:

http://www.dhtmlx.com/docs/products/dhtmlxCalendar/index.shtml

Tks.


Rafael Lima
Answer posted by Alex (support) on Oct 12, 2009 07:13

Hello, 

is the issue still actual ? 

Locally it wasn't reproduced.

Answer posted by Rafael Lima on Oct 19, 2009 05:09
Yes, when I use Mozilla Firefox 3.5, this problem still happening.

When I click on the calendar choosing Oct 18th, appears Oct 17th, in the website samples too.

My locale configuration is set with Portuguese-Brazil(Pt_br).

Tks.

Answer posted by Alex (support) on Oct 19, 2009 08:09

We have tested samples with the mentioned locale. This issue still isn't  reproduced. 

Could you please provide some details: 

- the direct link to the sample from our website

- how to recreate the issue

- does the problem occur only with Oct 18th date (or other dates) ? 

Answer posted by Rafael Lima - Relato Informatica on Oct 19, 2009 08:51
Hi, I`m sending an attachment with an image from your website.

Maybe it`s a problem with javascript date format, cause it happens with another dates, always in October.

October 18th 2009
October 19th 2008
October 21th 2007

I believe that`s a problem with Pt_br format, because you don`t reproduce this issue locally.

Tks.
Attachments (1)
Answer posted by Rafael Lima - Relato Informatica on Oct 19, 2009 13:14
Hi, I solve the problem changing this function in dhtmlxcalendar.js.


  cutTime:function(date) {
      date = new Date(date);
      var ndate = new Date(date.getFullYear(), date.getMonth(), date.getDate(),1,1,1,1);
      return ndate;
  }


For some reason, maybe UTC, when I put new Date using hour, minute and second, solve the problem.

Thanks.
Answer posted by Alex (support) on Oct 20, 2009 03:27

Hello, 

thank you very much for the provided solution. We will include it into the official version of dhtmlxcalendar.