convert timesheets to UTC with support for user timezone (#372)
This commit is contained in:
@@ -40,6 +40,7 @@ class DateExtensions extends \Twig_Extension
|
||||
new TwigFilter('month_name', [$this, 'monthName']),
|
||||
new TwigFilter('date_short', [$this, 'dateShort']),
|
||||
new TwigFilter('date_time', [$this, 'dateTime']),
|
||||
new TwigFilter('time', [$this, 'time']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -65,6 +66,15 @@ class DateExtensions extends \Twig_Extension
|
||||
return date_format($date, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $date
|
||||
* @return string
|
||||
*/
|
||||
public function time(DateTime $date)
|
||||
{
|
||||
return date_format($date, 'H:i');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $date
|
||||
* @return string
|
||||
|
||||
Reference in New Issue
Block a user