Improved date functions handling

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@214733 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2010-03-07 22:52:38 +00:00
parent 4baf57dca8
commit 65b683b42b
3 changed files with 5 additions and 1 deletions
+3
View File
@@ -141,7 +141,10 @@
);
$sql = str_replace( 'ORDER BY post_date DESC', 'ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC', $sql);
$sql = str_replace( 'ORDER BY post_date ASC', 'ORDER BY YEAR(post_date) ASC, MONTH(post_date) ASC', $sql);
$sql = str_replace( array_keys($date_funcs), array_values($date_funcs), $sql);
$curryear = date( 'Y');
$sql = str_replace( 'FROM \''.$curryear, 'FROM TIMESTAMP \''.$curryear, $sql);
// MySQL 'IF' conversion
$pattern = '/IF[ ]*\(([^,]+),([^,]+),([^\)]+)\)/';