'raw time span'=>t('Time span (future dates have "-" prepended)'),
'raw time span'=>t('Time span (future dates have "-" prepended)'),
...
@@ -49,8 +52,39 @@ class views_handler_field_date extends views_handler_field {
...
@@ -49,8 +52,39 @@ class views_handler_field_date extends views_handler_field {
'#title'=>t('Custom date format'),
'#title'=>t('Custom date format'),
'#description'=>t('If "Custom", see the <a href="@url" target="_blank">PHP manual</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.',array('@url'=>'http://php.net/manual/function.date.php')),
'#description'=>t('If "Custom", see the <a href="@url" target="_blank">PHP manual</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.',array('@url'=>'http://php.net/manual/function.date.php')),
'#dependency'=>array('edit-options-date-format'=>array('custom','raw time ago','time ago','raw time hence','time hence','raw time span','time span','raw time span','inverse time span','time span')),
'#dependency'=>array('edit-options-date-format'=>array('custom','raw time ago','time ago','today time ago','raw time hence','time hence','raw time span','time span','raw time span','inverse time span','time span')),
);
);
$form['second_date_format']=array(
'#type'=>'select',
'#title'=>t('Second date format'),
'#options'=>$date_formats+array(
'custom'=>t('Custom'),
),
'#description'=>t('The date format which will be used for rendering dates other than today.'),
'#dependency'=>array('edit-options-date-format'=>array('today time ago')),
);
$form['second_date_format_custom']=array(
'#type'=>'textfield',
'#title'=>t('Custom date format of second date'),
'#description'=>t('If "Custom" is selected in "Second date format", see the <a href="@url" target="_blank">PHP manual</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.',array('@url'=>'http://php.net/manual/function.date.php')),
@@ -66,7 +100,7 @@ class views_handler_field_date extends views_handler_field {
...
@@ -66,7 +100,7 @@ class views_handler_field_date extends views_handler_field {
functionrender($values){
functionrender($values){
$value=$this->get_value($values);
$value=$this->get_value($values);
$format=$this->options['date_format'];
$format=$this->options['date_format'];
if(in_array($format,array('custom','raw time ago','time ago','raw time hence','time hence','raw time span','time span','raw time span','inverse time span','time span'))){
if(in_array($format,array('custom','raw time ago','time ago','today time ago','raw time hence','time hence','raw time span','time span','raw time span','inverse time span','time span'))){