mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:14:29 -04:00
Fix for #445
This commit is contained in:
parent
c332c92788
commit
254a819e92
@ -56,7 +56,7 @@ class TaskController extends BaseController
|
||||
}
|
||||
|
||||
return $table->addColumn('created_at', function($model) { return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model)); })
|
||||
->addColumn('time_log', function($model) { return gmdate('H:i:s', Task::calcDuration($model)); })
|
||||
->addColumn('time_log', function($model) { return Utils::formatTime(Task::calcDuration($model)); })
|
||||
->addColumn('description', function($model) { return $model->description; })
|
||||
->addColumn('invoice_number', function($model) { return self::getStatusLabel($model); })
|
||||
->addColumn('dropdown', function ($model) {
|
||||
|
@ -330,16 +330,6 @@ class Utils
|
||||
return $date->format($format);
|
||||
}
|
||||
|
||||
public static function getTimestampOffset()
|
||||
{
|
||||
$timezone = new DateTimeZone(Session::get(SESSION_TIMEZONE, DEFAULT_TIMEZONE));
|
||||
$datetime = new DateTime('now', $timezone);
|
||||
$offset = $timezone->getOffset($datetime);
|
||||
$minutes = $offset / 60;
|
||||
|
||||
return $minutes;
|
||||
}
|
||||
|
||||
public static function toSqlDate($date, $formatResult = true)
|
||||
{
|
||||
if (!$date) {
|
||||
@ -379,6 +369,13 @@ class Utils
|
||||
return $formatResult ? $dateTime->format($format) : $dateTime;
|
||||
}
|
||||
|
||||
public static function formatTime($t)
|
||||
{
|
||||
// http://stackoverflow.com/a/3172665
|
||||
$f = ':';
|
||||
return sprintf("%02d%s%02d%s%02d", floor($t/3600), $f, ($t/60)%60, $f, $t%60);
|
||||
}
|
||||
|
||||
public static function today($formatResult = true)
|
||||
{
|
||||
$timezone = Session::get(SESSION_TIMEZONE, DEFAULT_TIMEZONE);
|
||||
|
@ -50,7 +50,7 @@
|
||||
<p/>
|
||||
|
||||
@if ($task->hasPreviousDuration())
|
||||
{{ trans('texts.duration') . ': ' . gmdate('H:i:s', $task->getDuration()) }}<br/>
|
||||
{{ trans('texts.duration') . ': ' . Utils::formatTime($task->getDuration()) }}<br/>
|
||||
@endif
|
||||
|
||||
@if (!$task->is_running)
|
||||
|
Loading…
x
Reference in New Issue
Block a user