You are here

function views_handler_arg_fulldate in Views (for Drupal 7) 5

1 string reference to 'views_handler_arg_fulldate'
node_views_arguments in modules/views_node.inc

File

modules/views_node.inc, line 635

Code

function views_handler_arg_fulldate($op, &$query, $argtype, $arg = '') {
  $timezone = _views_get_timezone();
  switch ($op) {
    case 'summary':
      $fieldinfo['field'] = "DATE_FORMAT(FROM_UNIXTIME(node.created+{$timezone}), '%Y%m%%d')";
      $fieldinfo['fieldname'] = 'name';
      $query
        ->add_field('created');
      return $fieldinfo;
      break;
    case 'sort':
      $query
        ->add_orderby(NULL, "DATE_FORMAT(FROM_UNIXTIME(node.created+{$timezone}), '%Y%m%%d')", $argtype, 'name');
      break;
    case 'filter':
      $query
        ->add_where("DATE_FORMAT(FROM_UNIXTIME(node.created+{$timezone}), '%Y%m%%d') = '%s'", $arg);
      break;
    case 'link':
      return l(format_date($query->created, 'custom', 'F j, Y'), "{$arg}/{$query->name}");
    case 'title':
      return format_date(strtotime($query), 'custom', 'F j, Y');
  }
}