6.0.0-alpha12
6/7/25

[#1482] Viewing calendar broken with postgres & non-ISO date format - with fix
Summary Viewing calendar broken with postgres & non-ISO date format - with fix
Queue Kronolith
Queue Version 2.0.2
Type Bug
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester oliver (at) gtwebmarque (dot) com
Created 03/03/2005 (7401 days ago)
Due
Updated 03/03/2005 (7401 days ago)
Assigned
Resolved 03/03/2005 (7401 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/03/2005 10:44:15 PM Chuck Hagenbuch Comment #2
Assigned to Chuck Hagenbuch
State ⇒ Resolved
Reply to this comment
Fixed in CVS and for 2.0.3 - thanks!
03/03/2005 10:35:18 PM oliver (at) gtwebmarque (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Viewing calendar broken with postgres & non-ISO date format - with fix
Queue ⇒ Kronolith
Reply to this comment
If using a postgresql database with the datestyle set to a non-default 
value (mine is 'SQL, DMY' for UK format dates), no events will show up 
on the calendar.

This is because SQL queries are composed in the ISO format YYYY-MM-DD.



To fix this, in kronolith/lib/Driver/sql.php, after lines 493-502 
(case 'oci8': ... break;) add the following extra case for postgres:



             case 'pgsql':

                 $query = "SET datestyle TO 'iso'";



                 /* Log the query at a DEBUG log level. */

                 Horde::logMessage(sprintf('SQL session setup by %s: 
query = "%s"',

                                           Auth::getAuth(), $query),

                                   __FILE__, __LINE__, PEAR_LOG_DEBUG);



                 $this->_db->query($query);

                 break;


Saved Queries