diff --git a/includes/common.inc b/includes/common.inc index 56166cda8bd389f7eb7f1552b69c2316c4d88312..6e79e66734bfa617d3070d2d370d41674310aad9 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1946,14 +1946,14 @@ function format_interval($timestamp, $granularity = 2, $langcode = NULL) { /** * Format a date with the given configured format or a custom format string. * - * Drupal allows administrators to select formatting strings for 'small', - * 'medium' and 'large' date formats. This function can handle these formats, + * Drupal allows administrators to select formatting strings for 'short', + * 'medium' and 'long' date formats. This function can handle these formats, * as well as any custom format. * * @param $timestamp * The exact date to format, as a UNIX timestamp. * @param $type - * The format to use. Can be "small", "medium" or "large" for the preconfigured + * The format to use. Can be "short", "medium" or "long" for the preconfigured * date formats. If "custom" is specified, then $format is required as well. * @param $format * A PHP date format string as required by date(). A backslash should be used @@ -1991,10 +1991,10 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL } switch ($type) { - case 'small': + case 'short': $format = variable_get('date_format_short', 'm/d/Y - H:i'); break; - case 'large': + case 'long': $format = variable_get('date_format_long', 'l, F j, Y - H:i'); break; case 'custom': diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index dbb8f16c08d104e86f2706d938f9e179bdd6f862..fcb1adf7a1ac0f9862ee62c99622487f79b349be 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -89,7 +89,7 @@ function comment_admin_overview($type = 'new', $arg) { 'subject' => l($comment->subject, 'comment/' . $comment->cid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid)), 'author' => theme('username', $comment), 'posted_in' => l($comment->node_title, 'node/' . $comment->nid), - 'time' => format_date($comment->timestamp, 'small'), + 'time' => format_date($comment->timestamp, 'short'), 'operations' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination)), ); } diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index ed9b798574640f396c8fed8b3a280664a7d92d93..1eb27794e39b4a0b0508874607bc502d4eba1786 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -64,7 +64,7 @@ function dblog_overview() { // Cells $icons[$dblog->severity], t($dblog->type), - format_date($dblog->timestamp, 'small'), + format_date($dblog->timestamp, 'short'), l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/' . $dblog->wid, array('html' => TRUE)), theme('username', $dblog), $dblog->link, @@ -148,7 +148,7 @@ function dblog_event($id) { ), array( array('data' => t('Date'), 'header' => TRUE), - format_date($dblog->timestamp, 'large'), + format_date($dblog->timestamp, 'long'), ), array( array('data' => t('User'), 'header' => TRUE), diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index b6b9a95220617d1bcd50b8809f63639d37871b2a..f2826f8aae74974d403d53c4b8395020f3ee7a0e 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -451,7 +451,7 @@ function node_admin_nodes() { $form['name'][$node->nid] = array('#markup' => check_plain(node_type_get_name($node))); $form['username'][$node->nid] = array('#markup' => theme('username', $node)); $form['status'][$node->nid] = array('#markup' => ($node->status ? t('published') : t('not published'))); - $form['changed'][$node->nid] = array('#markup' => format_date($node->changed, 'small')); + $form['changed'][$node->nid] = array('#markup' => format_date($node->changed, 'short')); if ($multilanguage) { $form['language'][$node->nid] = array('#markup' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name)); } diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 46a07c1cd48228463e01bbbffdd039d59312636a..af5f2ffd57d5d9592c14be92791f2158e6eb19fe 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -500,13 +500,13 @@ function node_revision_overview($node) { $operations = array(); if ($revision->current_vid > 0) { - $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), '!username' => theme('username', $revision))) + $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', $revision))) . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''), 'class' => array('revision-current')); $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => array('revision-current'), 'colspan' => 2); } else { - $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) + $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''); if ($revert_permission) { $operations[] = l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert"); diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index da634f59059a63b45a7739f073257d5bf548508d..cdac3350f01a57be864fb77f3fd2e598b30e48b8 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -102,7 +102,7 @@ function template_preprocess_search_result(&$variables) { $info['user'] = $result['user']; } if (!empty($result['date'])) { - $info['date'] = format_date($result['date'], 'small'); + $info['date'] = format_date($result['date'], 'short'); } if (isset($result['extra']) && is_array($result['extra'])) { $info = array_merge($info, $result['extra']); diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index f786a42e9b1662560da0606cd2eff0f170834367..13aad21e0670faa5c5e7b3822ca9d37ad9c54963 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -1244,9 +1244,9 @@ class FormatDateUnitTest extends DrupalWebTestCase { $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', t('Test a different language.')); $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London'), 'Monday, 26-Mar-07 01:00:00 BST', t('Test a different time zone.')); $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T'), 'domingo, 25-Mar-07 17:00:00 PDT', t('Test custom date format.')); - $this->assertIdentical(format_date($timestamp, 'large'), 'domingo, 25. marzo 2007 - 17:00', t('Test long date format.')); + $this->assertIdentical(format_date($timestamp, 'long'), 'domingo, 25. marzo 2007 - 17:00', t('Test long date format.')); $this->assertIdentical(format_date($timestamp, 'medium'), '25. marzo 2007 - 17:00', t('Test medium date format.')); - $this->assertIdentical(format_date($timestamp, 'small'), '2007 Mar 25 - 5:00pm', t('Test short date format.')); + $this->assertIdentical(format_date($timestamp, 'short'), '2007 Mar 25 - 5:00pm', t('Test short date format.')); $this->assertIdentical(format_date($timestamp), '25. marzo 2007 - 17:00', t('Test default date format.')); // Restore the original user and language, and enable session saving. diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index e33db8135bc37099dbf034b728e942088b7b1acf..9139a2567afbc5a54af05c33bd8c693b5c4ac3c8 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -29,7 +29,7 @@ function statistics_recent_hits() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid")); @@ -221,7 +221,7 @@ function statistics_access_log($aid) { ); $rows[] = array( array('data' => t('Date'), 'header' => TRUE), - format_date($access->timestamp, 'large') + format_date($access->timestamp, 'long') ); $rows[] = array( array('data' => t('User'), 'header' => TRUE), diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc index 1dcd3e0fac5476624514e6847d476f430702e9cf..5d5e799da8e133d129bd623cde8a3c31dae2ea16 100644 --- a/modules/statistics/statistics.pages.inc +++ b/modules/statistics/statistics.pages.inc @@ -31,7 +31,7 @@ function statistics_node_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_link($log->url), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid"), @@ -74,7 +74,7 @@ function statistics_user_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), l(t('details'), "admin/reports/access/$log->aid")); } diff --git a/modules/system/system.test b/modules/system/system.test index 828ab0e857311f1b1bd5322dfef9257c83d539e2..b5176fd853c370d85b328d1d9fc6dfd626e3981c 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1218,7 +1218,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { $source .= '[node:created:since]'; // Time since the node was created $source .= '[current-user:name]'; // Current user's name $source .= '[user:name]'; // No user passed in, should be untouched - $source .= '[date:small]'; // Small date format of REQUEST_TIME + $source .= '[date:short]'; // Short date format of REQUEST_TIME $source .= '[bogus:token]'; // Nonexistent token, should be untouched $target = check_plain($node->title); @@ -1226,7 +1226,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { $target .= format_interval(REQUEST_TIME - $node->created, 2); $target .= check_plain($user->name); $target .= '[user:name]'; - $target .= format_date(REQUEST_TIME, 'small'); + $target .= format_date(REQUEST_TIME, 'short'); $target .= '[bogus:token]'; $result = token_replace($source, array('node' => $node)); diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index 5ab7a573bc8961fe635d67d21db764b68179a24a..07afe5debc1771098a64c304142e16d00d877700 100644 --- a/modules/system/system.tokens.inc +++ b/modules/system/system.tokens.inc @@ -54,17 +54,17 @@ function system_token_info() { ); // Date related tokens. - $date['small'] = array( - 'name' => t("Small format"), - 'description' => t("A date in 'small' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'small'))), + $date['short'] = array( + 'name' => t("Short format"), + 'description' => t("A date in 'short' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'short'))), ); $date['medium'] = array( 'name' => t("Medium format"), 'description' => t("A date in 'medium' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'medium'))), ); - $date['large'] = array( - 'name' => t("Large format"), - 'description' => t("A date in 'large' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'large'))), + $date['long'] = array( + 'name' => t("Long format"), + 'description' => t("A date in 'long' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'long'))), ); $date['custom'] = array( 'name' => t("Custom format"), @@ -203,16 +203,16 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a $replacements[$original] = filter_xss($date); break; - case 'small': - $replacements[$original] = format_date($date, 'small', '', NULL, $langcode); + case 'short': + $replacements[$original] = format_date($date, 'short', '', NULL, $langcode); break; case 'medium': $replacements[$original] = format_date($date, 'medium', '', NULL, $langcode); break; - case 'large': - $replacements[$original] = format_date($date, 'large', '', NULL, $langcode); + case 'long': + $replacements[$original] = format_date($date, 'long', '', NULL, $langcode); break; case 'since':