You are here

function course_date_api_fields in Course 6

Implements hook_date_api_fields().

Expose the course date columns to date API.

File

./course.module, line 2562
course.module Core functionality for Courses.

Code

function course_date_api_fields($field) {
  $values = array(
    'sql_type' => DATE_UNIX,
    'granularity' => array(
      'year',
      'month',
      'day',
    ),
  );
  switch ($field) {
    case 'course_report.date_completed':
    case 'course_report.updated':
    case 'course_enrolment.timestamp':
    case 'course_enrolment.enrol_end':
    case 'course_node.open':
    case 'course_node.close':
      return $values;
  }
}