Welcome, Guest
Username Password: Remember me
Keyword

TOPIC: Date mismatch on GAD

Date mismatch on GAD 1 year, 2 months ago #10711

  • mpolo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello,
I have a problem on the GAD, I have set up a resource that is only available on monday and restricted the Disable Dates in the way it shows up just on Monday April 2nd.
In the Gad the resource shows up but for the day before, Sunday April 1st.
The very strange thing is, as you can see in the screenshot, mouseovering the date, the javascript code shows the correct date: in fact if I click on the April 1st date, the GAD shows me April 2nd.

errore_abpro.gif


I already tried both patches $jdate_fix and commenting the lines as suggested here without success.

I run Joomla 2.5.3 on linux centos.
thank you for your support.

Re: Date mismatch on GAD 1 year, 2 months ago #10712

  • admin2
  • OFFLINE
  • Moderator
  • Posts: 6203
  • Karma: 146
Try 2.0.3, beta 6 Mar 23/12.

Re: Date mismatch on GAD 1 year, 2 months ago #10714

  • mpolo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
uh just published the new release! trying it now. thank you.

Re: Date mismatch on GAD 1 year, 2 months ago #10715

  • mpolo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
nope, it has not been fixed with beta6
this is the source code:
<td align="center" class="sv_gad_timeslot_yaxis_header"><a href="javascript:changeMode2('2012-04-02')"> Dom 01-Apr-2012</a></td>


I've temporarely patched by myself gad_ajax.php at line 571 setting $day+1 in the DateAdd function, of course it should be just a display error not compromising anything else.

The code behind the timeslot is correct:
<a class="sv_gad_timeslot_clickable" onclick="selectTimeslot('1|Q29yc28gZGkgUGFzcXVh|2012-04-02|RG9tIDAxLUFwci0yMDEy|18:45:00|MTg6NDU=|22:00:00|MjI6MDA=|ts1', event);return false;" onmouseover="checkWhoBooked("ts1");return true;" href="#">5</a>

there is 2012-04-02

but when I click on the timeslot, the booking remainder line still says April 1st. anyway if I confirm the booking I correctly have April 2nd reserved
Last Edit: 1 year, 2 months ago by mpolo. Reason: more infos

Re: Date mismatch on GAD 1 year, 1 month ago #10716

  • admin2
  • OFFLINE
  • Moderator
  • Posts: 6203
  • Karma: 146
I am guessing you are in GMT+1 time zone.
I have had some problems reported there that I cannot reproduce here, even when I setup a server with that timezone.

Re: Date mismatch on GAD 1 year, 1 month ago #10717

  • admin2
  • OFFLINE
  • Moderator
  • Posts: 6203
  • Karma: 146
Additional..
In J1.5 ABPro used php date functions. A bug introduced in J1.6 broke code that used native php so ABPro was switched to use JDate, with a work around for the toFormat bug.

There seems to be a new JDate problem with timezones and DST that only really shows up with timezone right around UTC(GMT). This can be see in the date showing different in the changeMode vs the displayed date. One uses php the other JDate.

Bottom line, is you could go back to pure php now the original Joomla bug is fixed.

I cannot test this as I cannot get it to fail, it shows the correct date regardless of weather I use php date or JDate.

To test edit file: gad_ajax.php

Around line 585 look for:
$weekday = date("w",(DateAdd("d", $day, strtotime($grid_date))));
$strDate = date("Y-m-d",(DateAdd("d", $day, strtotime($grid_date))));

Add an override for $dayname, which was set a few line earlier with JDate.
$weekday = date("w",(DateAdd("d", $day, strtotime($grid_date))));
$strDate = date("Y-m-d",(DateAdd("d", $day, strtotime($grid_date))));

$dayname = date('D d-M-Y',(DateAdd("d", $day, strtotime($grid_date))));

Now php is used for all dates in the single-resource-multi-day view.

It should also be noted, the JDate's toFormat() uses a different type of format string than does php date(), so the format string stored in your ABPro config will be wrong. I have set the format in the date call to 'D d-M-Y'.
Last Edit: 1 year, 1 month ago by admin2.
Time to create page: 0.48 seconds