From c1947ca1ae4dfa01de5c3ebe32091c0789af77a1 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Sat, 2 Aug 2014 18:49:14 +0530 Subject: [PATCH] Fix #4: Default language to en when no locale found --- daterange/DateRangePicker.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/daterange/DateRangePicker.php b/daterange/DateRangePicker.php index d2e5efb..b1e4d9e 100644 --- a/daterange/DateRangePicker.php +++ b/daterange/DateRangePicker.php @@ -115,12 +115,10 @@ class DateRangePicker extends \kartik\widgets\InputWidget public function init() { parent::init(); - $this->initI18N(); if (!$this->checkLocale()) { - throw new InvalidConfigException("The locales have not been setup for your language '{$this->language}'. \n - You can submit the translations by reading the DateRangePicker documentation. \n - Alternatively, to continue without using any translations set the 'language' property to 'en' in your widget configuration."); + $this->language = 'en'; } + $this->initI18N(); if ($this->convertFormat && isset($this->pluginOptions['format'])) { $this->pluginOptions['format'] = static::convertDateFormat($this->pluginOptions['format']); }