You are here

function views_rdf_is_date in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_rdf.module \views_rdf_is_date()

If input is a serialized date array, return a date string

Parameters

$input: Input to check.

Return value

Either the original input or a date string.

File

./views_rdf.module, line 253
Module definition for views_rdf

Code

function views_rdf_is_date($input) {
  if (strpos($input, 'a:3:{s:5:"month"') !== 0) {
    return $input;
  }
  else {

    // serialized date array
    $date = unserialize($input);
    return format_date(mktime(0, 0, 0, $date['month'], $date['day'], $date['year']), 'custom', DATE_ISO8601);
  }
}