You are here

function visitors_date_format_sql in Visitors 7

Same name and namespace in other branches
  1. 8.2 visitors.module \visitors_date_format_sql()
  2. 8 visitors.module \visitors_date_format_sql()
  3. 7.2 visitors.module \visitors_date_format_sql()
  4. 7.0 visitors.module \visitors_date_format_sql()

Set date format for sql query.

Parameters

$field_name string field name:

$format string date format:

Return value

string date format

5 calls to visitors_date_format_sql()
chart_visitors_monthly_history in reports/monthly_history.inc
Display monthly history chart report.
visitors_days_of_month_data in reports/days_of_month.inc
Get data for days of month report order the query based on a header array.
visitors_days_of_week_data in reports/days_of_week.inc
Get data for days of week report order the query based on a header array.
visitors_hours_data in reports/hours.inc
Get data for hours report order the query based on a header array.
visitors_monthly_history in reports/monthly_history.inc
Display monthly history report.

File

./visitors.module, line 280

Code

function visitors_date_format_sql($field_name, $format) {
  switch (Database::getConnection()
    ->driver()) {
    case 'pgsql':
      return visitors_pgsql_date_format_sql($field_name, $format);
      break;
    case 'sqlite':
      return visitors_sqlite_date_format_sql($field_name, $format);
      break;
    default:
      return visitors_mysql_date_format_sql($field_name, $format);
  }
}