CRUDlex\TwigExtensions::formatDate PHP Method

formatDate() public method

Formats the given value to a date of the format 'Y-m-d'.
public formatDate ( string $value, boolean $isUTC ) : string
$value string the value, might be of the format 'Y-m-d H:i' or 'Y-m-d'
$isUTC boolean whether the given value is in UTC
return string the formatted result or an empty string on null value
    public function formatDate($value, $isUTC)
    {
        $timezone = $isUTC ? 'UTC' : date_default_timezone_get();
        return $this->formatTime($value, $timezone, 'Y-m-d');
    }