Commit 4d1d07fb authored by Evan Goldenberg's avatar Evan Goldenberg
Browse files

explicitly cast postgres to_date function arguments to text


Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
parent 25626896
...@@ -387,7 +387,7 @@ function user_stats_table($limit, $offset) { ...@@ -387,7 +387,7 @@ function user_stats_table($limit, $offset) {
return $result; return $result;
} }
$day = is_postgres() ? "to_date(t.ctime, 'YYYY-MM-DD')" : 'DATE(t.ctime)'; $day = is_postgres() ? "to_date(t.ctime::text, 'YYYY-MM-DD')" : 'DATE(t.ctime)';
$daterange = get_record_sql( $daterange = get_record_sql(
"SELECT "SELECT
...@@ -406,7 +406,7 @@ function user_stats_table($limit, $offset) { ...@@ -406,7 +406,7 @@ function user_stats_table($limit, $offset) {
$dayinterval = is_postgres() ? "'1 day'" : '1 day'; $dayinterval = is_postgres() ? "'1 day'" : '1 day';
$day = is_postgres() ? "to_date(ctime, 'YYYY-MM-DD')" : 'DATE(ctime)'; $day = is_postgres() ? "to_date(ctime::text, 'YYYY-MM-DD')" : 'DATE(ctime)';
$userdata = get_records_sql_array( $userdata = get_records_sql_array(
"SELECT ctime, type, value, $day AS date "SELECT ctime, type, value, $day AS date
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment