atnospeat / joomla-gcalendar

Automatically exported from code.google.com/p/joomla-gcalendar
0 stars 0 forks source link

SOLVED! Events after a certain time not showing up on day view + Month view cutting off last event #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Allon!

I just wanted to see if you would incorporate this change in your next
version. I was having a lot of trouble with events not showing up after
certain hours and events missing from the calendar view. This small change
cleared everything up and I don't think it will mess with anything. Please
let me know if this works for you!

Best,
Justin

Here's the file:
/administrator/components/com_gcalendar/libraries/sp-gcalendar/simplepie-gcalend
ar.php

Changes to make:
--
In function set_start_date, change the following:
$this->start_date = strftime('%Y-%m-%dT%H:%M:%S', $value);

to this:
$this->start_date = strptime($value, '%Y-%m-%dT%H:%M:%S');
--
In function set_end_date, change the following:
$this->end_date = strftime('%Y-%m-%dT%H:%M:%S', $value);

to this:
$this->end_date = strptime($value, '%Y-%m-%dT%H:%M:%S');
--

What version are you using?
GCalendar:2.1.2
joomla:1.5.14
php:5.2.5
mysql:5.0.81-community
apache: 2.0.63
os: Linux
Browser:Firefox 3.5.2, IE7

Original issue reported on code.google.com by iamwag...@gmail.com on 21 Aug 2009 at 6:51

GoogleCodeExporter commented 9 years ago
what should be the advantage of this function? using this function gcalendar is 
not
php4 compatible and does not run on windows platform which will result in 
complaints
of users.....

but thanks anyway for your help perhaps there is another way to solve this 
problem.
does the commit for revision r610 not help?

Original comment by allon.mo...@gmail.com on 21 Aug 2009 at 1:54

GoogleCodeExporter commented 9 years ago
Hey Allon!

I really love this component and I'm happy to help if I can! If you can find 
another
way to address this issue, that would be great! r610 did not solve for my 
issues. I
also tried using "$this->start_date = mktime($value);". That solved the initial 
issue
but it made the recurring events fail. The method I described above worked for 
me
however. Is there a PHP4 compatible version of that? I'll look around and see 
if I
can find anything.

Thanks again for all your great work!

Best,
Justin

Original comment by iamwag...@gmail.com on 21 Aug 2009 at 3:10

GoogleCodeExporter commented 9 years ago
How about this?
--
if ((version_compare(PHP_VERSION, '5.1.0', '>=')) && (stristr(php_os, 'WIN'))) {
    $this->start_date = strftime('%Y-%m-%dT%H:%M:%S', $value);
}else if(version_compare(PHP_VERSION, '5.1.0', '>=')){
    $this->start_date = strptime($value, '%Y-%m-%dT%H:%M:%S');
}else{
    $this->start_date = strftime('%Y-%m-%dT%H:%M:%S', $value);
}
--
if ((version_compare(PHP_VERSION, '5.1.0', '>=')) && (stristr(php_os, 'WIN'))) {
    $this->end_date = strftime('%Y-%m-%dT%H:%M:%S', $value);
}else if(version_compare(PHP_VERSION, '5.1.0', '>=')){
    $this->end_date = strptime($value, '%Y-%m-%dT%H:%M:%S');
}else{
    $this->end_date = strftime('%Y-%m-%dT%H:%M:%S', $value);
}
--

Original comment by iamwag...@gmail.com on 21 Aug 2009 at 3:57

GoogleCodeExporter commented 9 years ago
I have changed my php.ini to my locale with no effect. I think this is why I'm 
having
the trouble:

The result of strptime() is not affected by the current timezone setting, even 
though
strftime() is. Tested in PHP 5.1.6.

Taken from http://us2.php.net/manual/en/function.strptime.php

Original comment by iamwag...@gmail.com on 21 Aug 2009 at 4:01