Commit f861a401 authored by merlinofchaos's avatar merlinofchaos

#103649: allow customizing date interval granularity

parent 1d6e44c0
......@@ -90,6 +90,8 @@ Views --dev
o All the date-based arguments were broken due to changes in $query->add_orderby
o 103475: updated rss feed to match fixes in Drupal core.
o 103773: Fixed some obnoxious t() % placeholder <em> stupidity.
o Replaced theme_views_nodate with theme('views_nodate') which is actually themable.
New Features:
o 89421: New last changed sort / filter / field
o 103649: allow customizing date interval granularity
......@@ -1467,35 +1467,35 @@ function theme_views_summary($view, $type, $level, $nodes, $args) {
* Format a date.
*/
function views_handler_field_date($fieldinfo, $fielddata, $value, $data) {
return $value ? format_date($value) : theme_views_nodate();
return $value ? format_date($value) : theme('views_nodate');
}
/**
* Format a date using small representation.
*/
function views_handler_field_date_small($fieldinfo, $fielddata, $value, $data) {
return $value ? format_date($value, 'small') : theme_views_nodate();
return $value ? format_date($value, 'small') : theme('views_nodate');
}
/**
* Format a date using large representation.
*/
function views_handler_field_date_large($fieldinfo, $fielddata, $value, $data) {
return $value ? format_date($value, 'large') : theme_views_nodate();
return $value ? format_date($value, 'large') : theme('views_nodate');
}
/**
* Format a date using custom representation.
*/
function views_handler_field_date_custom($fieldinfo, $fielddata, $value, $data) {
return $value ? format_date($value, 'custom', $fielddata['options']) : theme_views_nodate();
return $value ? format_date($value, 'custom', $fielddata['options']) : theme('views_nodate');
}
/**
* Format a date as "X time ago".
*/
function views_handler_field_since($fieldinfo, $fielddata, $value, $data) {
return $value ? t('%time ago', array('%time' => format_interval(time() - $value))) : theme_views_nodate();
return $value ? t('%time ago', array('%time' => format_interval(time() - $value, is_numeric($fielddata['options']) ? $fielddata['options'] : 2))) : theme('views_nodate');
}
function theme_views_nodate() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment