From 7fdd6f66dcf43aab0c5f5572ebac8c759f8d38af Mon Sep 17 00:00:00 2001 From: Sleeping Owl Date: Thu, 16 Oct 2014 20:31:18 +0400 Subject: [PATCH] New exception when "intl" extension not installed --- src/SleepingOwl/DateFormatter/DateFormatter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SleepingOwl/DateFormatter/DateFormatter.php b/src/SleepingOwl/DateFormatter/DateFormatter.php index 8578ea2e..27f13237 100644 --- a/src/SleepingOwl/DateFormatter/DateFormatter.php +++ b/src/SleepingOwl/DateFormatter/DateFormatter.php @@ -17,6 +17,10 @@ public static function format($date, $dateFormat = self::SHORT, $timeFormat = se { $date = new Carbon($date); } + if ( ! function_exists('datefmt_create')) + { + throw new \Exception('You must install "intl" php extension.'); + } $formatter = datefmt_create(App::getLocale(), $dateFormat, $timeFormat); $pattern = $formatter->getPattern(); $pattern = str_replace('yy', 'y', $pattern);