Skip to content

Commit

Permalink
New exception when "intl" extension not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeping-owl committed Oct 16, 2014
1 parent 341f30a commit 7fdd6f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SleepingOwl/DateFormatter/DateFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7fdd6f6

Please sign in to comment.