protected function addDateDefaultFormatToTwig(Application $app)
    {
        $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, Application $app) {
            $defaultDateFormat = new \Twig_SimpleFilter('date_default_format', function (\DateTime $date) use ($app) {
                $format = isset($app['site.date_format']) ? $app['site.date_format'] : 'Y-m-d H:i:s';

                return $date->format($format);
            });
            $twig->addFilter($defaultDateFormat);

            return $twig;
        }));
    }