New function to format small and short dates

This commit is contained in:
Manuel Cillero 2017-09-17 08:14:59 +02:00
parent e2d79c1bb4
commit ce5f89b38f
18 changed files with 119 additions and 118 deletions

View file

@ -1721,7 +1721,7 @@ function storm_trash_list() {
l($node->title, "node/$node->nid"),
t($node_types[$node->type]),
t('!date by !username', array(
'!date' => format_date($node->changed, 'small'),
'!date' => _format_small_date($node->changed),
'!username' => theme('username', $node))),
$node->log,
array(
@ -2536,6 +2536,15 @@ function _timetostr($time=array()) {
return $timestr;
}
function _format_small_date($date = NULL) {
return format_date(empty($date) ? time() : $date, 'small');
}
function _format_short_date($date = NULL) {
$format_date = format_date(empty($date) ? time() : $date, 'small');
return substr($format_date, 0, strpos($format_date, ' '));
}
/**
* @function
@ -2834,7 +2843,6 @@ function storm_rewrite_sql($sql, $where = array(), $join = array()) {
$sql = str_replace($replace, $insert . $replace, $sql);
}
}
# drupal_set_message(print_r($sql, TRUE));
return $sql;
}
@ -2872,7 +2880,6 @@ function storm_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
break;
}
}
# drupal_set_message(print_r($return, TRUE));
return $return;
}
}