Skip to content

Commit

Permalink
Merge pull request #5 from OpenBuildings/timestamp-time
Browse files Browse the repository at this point in the history
Show exact time in timestamp title attribute
  • Loading branch information
hkdobrev authored Jun 29, 2016
2 parents f93d07c + d8ab7d1 commit b3a927b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions classes/Kohana/Tart/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected static function render_field(Jam_Model $item, Jam_Field $field)
return '-';

$time = is_numeric($value) ? $value : strtotime($value);
return '<span title="'.date('j M Y', $time).'">'.Tart_Html::date_span($time).'</span>';
return '<span title="'.date('j M Y H:i:s', $time).'">'.Tart_Html::date_span($time).'</span>';
}
elseif ($field instanceof Jam_Field_Weblink)
{
Expand All @@ -204,4 +204,4 @@ protected static function render_field(Jam_Model $item, Jam_Field $field)
return HTML::chars($value);
}
}
}
}
2 changes: 1 addition & 1 deletion tests/tests/columnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function test_default_fields()

$rendered = $column->name('created_at')->render();
$year_diff = ( (int) date('Y')) - ( (int) date('Y', $this->city->created_at));
$this->assertEquals('<span title="1 Jan 2000">'.$year_diff.' years ago</span>', $rendered);
$this->assertEquals('<span title="1 Jan 2000 14:30:00">'.$year_diff.' years ago</span>', $rendered);

$rendered = $column->name('url')->render();
$this->assertEquals('http://example.com/ths-is-a-ve…&nbsp;<a href="http://example.com/ths-is-a-very-lon-url/and-should-be-shortend" target="_blank"><i class="icon-share-alt"></i></a>', $rendered);
Expand Down

0 comments on commit b3a927b

Please sign in to comment.