You are here

function _views_xhtml_is_date in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_xhtml.module \_views_xhtml_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_xhtml.module, line 309
Module definition for views_xhtml

Code

function _views_xhtml_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);
  }
}