Page 1 of 1

Calendar & Date Problems

PostPosted: Fri May 12, 2006 7:58 am
Author: Eon
OK, I want to get all the input from the users about this.

What are all the problems that occuir with the dates being wrong on the calendar events?

Birthdays, events, etc.

If you have done any digging in this post code you think that might be suspect.

We want to try to fix this for 141, and I believe we are going to have to have all the help we can get.

If somebody still has a 132 forum, and the birthday events are working properly, then please speak up. We may need to use 132 code in order to fix this problem.

This is a community project, so let's all work together and get this annoying problem fixed for the next release.

PostPosted: Fri May 12, 2006 8:11 am
Author: Jason Sanborn
I have two sites running IntegraMod 1.4.0 (phpBB 2.0.19 and 2.0.20) and the problem exists on both sites.

If you are in the same timezone as the server, everything appears fine, but if you are in a different timezone, then the problem appears. It looks like it is reading server time, instead of whatever method is used for determining the user's local time.

Re: Calendar & Date Problems

PostPosted: Fri May 12, 2006 8:45 am
Author: Master Dwarf
I too am running 1.40 with all the updates in place.

One thing I notice is for recurring events, it is minor but can be a bit annoying.

You post a event to recur every x amount of days. The end date you choose must have a time that is later than your start date or the last day of the event will not display on the calendar. Example may be in order:

Topic: Card Game
Msg: To be at Freds at 6pm every Wednesday for month of May
Calendar event: 'select first wednesday, time defaults to posting time->change if desired'
Until: 'select last wednesday of month-time defaults to posting time'
Repeats: 1 week

Given the example if the time defaults are the same, the last wednesday, in the calendar, will not display the event. If you change it so that the time is AFTER the one displayed in 'Calendar event' field, then all is good.

Re: Calendar & Date Problems

PostPosted: Fri May 12, 2006 9:53 am
Author: evolver
Also, a complete translation of the calendar seems to be almost impossible...

I just say almost, because there has to be a way...
...there is always a way...

I tried...but I haven't found it yet <img>
Even when dates are translated after input, they won't be recognized by edit...
So, for every change on a topic-event, the date has to be entered again or that date will change to Dec 1969
That's a real hard-coded problem and a very annoying one as well...

Re: Calendar & Date Problems

PostPosted: Sat May 13, 2006 5:13 pm
Author: evolver
Why twice the same code on functions.php ???
-function user2boardtime(&$usertime)
-function board2usertime(&$usertime)
Code: Select all
function user2boardtime(&$usertime){     global $board_config, $db, $userdata;     if(!isset($board_config['real_board_timezone'])){         $sql = "select config_value from ".CONFIG_TABLE." where config_name = 'board_timezone'";         if(!$result = $db->sql_query($sql) ) {                 message_die(GENERAL_ERROR, 'Could not retrieve board_timezone', '', __LINE__, __FILE__, $sql);         }         $row = $db->sql_fetchrow($result);         $board_config['real_board_timezone'] = $row['config_value'];     }     $zonediff = $board_config['real_board_timezone'] - $board_config['board_timezone'];     $usersummer = 0;     $boardsummer = 0;     $summer = 0;     if($userdata['user_summer_time']) $usersummer = 1;     if($board_config['summer_time']) $boardsummer = 1;     if($boardsummer != $usersummer){         $summer = $boardsummer - $usersummer;     }     $zonediff = $zonediff + $summer;     $zonediff = $zonediff * 3600;     $usertime = $usertime + $zonediff; }  function board2usertime(&$usertime){     global $board_config, $db, $userdata;     if(!isset($board_config['real_board_timezone'])){         $sql = "select config_value from ".CONFIG_TABLE." where config_name = 'board_timezone'";         if(!$result = $db->sql_query($sql) ) {                 message_die(GENERAL_ERROR, 'Could not retrieve board_timezone', '', __LINE__, __FILE__, $sql);         }         $row = $db->sql_fetchrow($result);         $board_config['real_board_timezone'] = $row['config_value'];     }     $zonediff = $board_config['board_timezone'] - $board_config['real_board_timezone'];     $usersummer = 0;     $boardsummer = 0;     $summer = 0;     if($userdata['user_summer_time']) $usersummer = 1;     if($board_config['summer_time']) $boardsummer = 1;     if($boardsummer != $usersummer){         $summer = $usersummer - $boardsummer;     }     $zonediff = $zonediff + $summer;     $zonediff = $zonediff * 3600;     $usertime = $usertime + $zonediff; }

Both functions are almost completely the same with different names.

PostPosted: Sun May 14, 2006 12:26 am
Author: Adrian Rea
the 2 functions are to standardise the time differences from when the user enters a date, and a date known to the server. there are 16 instances of one and 8 of the other in the code.

A

Re: Calendar & Date Problems

PostPosted: Sun May 14, 2006 5:25 am
Author: evolver
Thanks Adrian :)
This modification isn't optimal yet, it's just a start...


[hr:e4x0kx4q][align=center:e4x0kx4q][size=99px]

In functions.php

I replaced[code]         //         // GET THE TIME TODAY AND YESTERDAY         //         /*$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['summer_time'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]); */         $today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $board_config['time_today'] = mktime(0,0,0,$today_ary[0],$today_ary[1],$today_ary[2]);         $board_config['time_yesterday'] = $board_config['time_today'] - 86400;         //unset($today_ary);         //-- end mod ]
With][code]         //         // GET THE TIME TODAY AND YESTERDAY         //         /*$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['summer_time'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]); */         $today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $time_today_used = mktime(0,0,0,$today_ary[0],$today_ary[1],$today_ary[2]);         $board_config['time_today'] = $time_today_used;         if ( isset($userdata['user_timezone']) )             {                 $board_config['time_today'] = $time_today_used - 25200;             }                 $board_config['time_yesterday'] = $board_config['time_today'] - 86400;         //unset($today_ary);         //-- end mod ][hr:e4x0kx4q]
[b]This modification is not optimal yet
, but this is working perfect for [color=red]my timezone
at this moment... :P

Re: Calendar & Date Problems

PostPosted: Sun May 14, 2006 9:47 am
Author: evolver
OK, I think I've got it right now... <img>

There's a function on functions.php that does the same thing:
function board2usertime
That was a good example to complete this code for every configuration...

[size=99px]

[size=99px]
REPLACE[code]         //         // GET THE TIME TODAY AND YESTERDAY         //         /*$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['summer_time'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]); */         $today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));         $time_today_used = mktime(0,0,0,$today_ary[0],$today_ary[1],$today_ary[2]);         $board_config['time_today'] = $time_today_used;         if ( isset($userdata['user_timezone']) )             {                         $zonedifference = $board_config['real_board_timezone'] - $board_config['board_timezone'];                           $usersummertime = 0;                         $boardsummertime = 0;                         if($userdata['user_summer_time']) $usersummertime = 1;                         if($board_config['summer_time']) $boardsummertime = 1;                           $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));                         $board_config['time_today'] = $time_today_used + ($zonedifference * 3600);             }                 $board_config['time_yesterday'] = $board_config['time_today'] - 86400;         //unset($today_ary);         //-- end mod ]

Hope this helps for everyone now <!-- s]HERE[/url]

PostPosted: Tue May 16, 2006 3:44 am
Author: Eon
Good Job Evolver.

That will get us going we have so many b ugs with the calendar it seems like.

If there is a way to apply this to birthdays and recurring events we will have the major bugs fixed.

PostPosted: Tue May 16, 2006 11:12 am
Author: evolver
"Eon";p="6067" wrote:Good Job Evolver.

That will get us going we have so many b ugs with the calendar it seems like.

If there is a way to apply this to birthdays and recurring events we will have the major bugs fixed.

Yes, I know...

I would like a complete list of all known timezone-bugs:
- birthdays
- topic review (under the posting editor for answers)
- minical date search
- ...

Can't promise anything, but I will see what I can do...
I've already tried to fix times on the 'topic review', but it didn't work...

Re: Calendar & Date Problems

PostPosted: Thu May 18, 2006 8:49 am
Author: evolver

PostPosted: Thu May 18, 2006 10:45 am
Author: Eon
Nice Evolver. Have you applied for a beta position? Cause with your debugging skills you sure would be handy.