From c7431bafc1b49e20d7da1bfc29b8ac1133595719 Mon Sep 17 00:00:00 2001 From: Jesse Beach Date: Fri, 4 Nov 2011 01:32:30 -0400 Subject: [PATCH] Issue #1183250 by jessebeach, linclark, ericduran, Everett Zufelt, sun, aspilicious, scor: Introduced theme_datetime Signed-off-by: Jesse Beach --- core/includes/common.inc | 3 ++ core/includes/theme.inc | 48 +++++++++++++++++++++++++++ core/modules/simpletest/tests/theme.test | 52 ++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 0 deletions(-) diff --git a/core/includes/common.inc b/core/includes/common.inc index 4229d52..5e0f806 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -6564,6 +6564,9 @@ function drupal_common_theme() { 'render element' => 'elements', 'template' => 'region', ), + 'datetime' => array( + 'variables' => array('timestamp' => NULL, 'text' => NULL, 'attributes' => array()), + ), 'status_messages' => array( 'variables' => array('display' => NULL), ), diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 5c38525..2aa71e0 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1460,6 +1460,29 @@ function theme_disable($theme_list) { */ /** + * Returns HTML for a date / time. + * + * @param $variables + * An associative array containing: + * - timestamp: (optional) A UNIX timestamp for the datetime. If the + * datetime cannot be represented as a UNIX timestamp, instead use a valid + * date string with optional time in $variables['attributes']['datetime'] + * and a human readable string in $variables['text']. + * - text: (optional) The text content to display in the