diff --git a/DateAsset.php b/DateAsset.php index 5bbf5f9..41445db 100644 --- a/DateAsset.php +++ b/DateAsset.php @@ -16,13 +16,18 @@ */ class DateAsset extends AssetBundle { - public $sourcePath = '@bower/persian-date/dist'; public $js = [ - '0.1.8/persian-date-0.1.8.js', + '0.1.8/persian-date-0.1.8.min.js', ]; public $depends = [ 'yii\web\JqueryAsset', 'yii\bootstrap\BootstrapPluginAsset', 'yii\bootstrap\BootstrapAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } } diff --git a/Datepicker.php b/Datepicker.php index 20ef075..63d0695 100644 --- a/Datepicker.php +++ b/Datepicker.php @@ -126,7 +126,6 @@ public function registerClientScript() $this->{'registerDatepicker' . ucfirst($this->theme) . 'ThemeAsset'}($view); } - $id = $this->options['id']; $selector = ";jQuery('#$id')"; diff --git a/DatepickerAsset.php b/DatepickerAsset.php index bd60f39..efda839 100644 --- a/DatepickerAsset.php +++ b/DatepickerAsset.php @@ -16,7 +16,6 @@ */ class DatepickerAsset extends AssetBundle { - public $sourcePath = '@bower/persian-datepicker/dist'; public $css = [ 'css/persian-datepicker-0.4.5.css', ]; @@ -26,4 +25,10 @@ class DatepickerAsset extends AssetBundle public $depends = [ 'mrlco\datepicker\DateAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } } diff --git a/DatepickerBlueThemeAsset.php b/DatepickerBlueThemeAsset.php index 880e799..4ca9a18 100644 --- a/DatepickerBlueThemeAsset.php +++ b/DatepickerBlueThemeAsset.php @@ -16,7 +16,6 @@ */ class DatepickerBlueThemeAsset extends AssetBundle { - public $sourcePath = '@bower/persian-datepicker/dist'; public $css = [ 'css/theme/persian-datepicker-blue.css', ]; @@ -26,4 +25,10 @@ class DatepickerBlueThemeAsset extends AssetBundle public $depends = [ 'mrlco\datepicker\DateAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } } diff --git a/DatepickerCheerupThemeAsset.php b/DatepickerCheerupThemeAsset.php index 5e6122d..a3eb9a4 100644 --- a/DatepickerCheerupThemeAsset.php +++ b/DatepickerCheerupThemeAsset.php @@ -16,7 +16,6 @@ */ class DatepickerCheerupThemeAsset extends AssetBundle { - public $sourcePath = '@bower/persian-datepicker/dist'; public $css = [ 'css/theme/persian-datepicker-cheerup.css', ]; @@ -26,4 +25,10 @@ class DatepickerCheerupThemeAsset extends AssetBundle public $depends = [ 'mrlco\datepicker\DateAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } } diff --git a/DatepickerDarkThemeAsset.php b/DatepickerDarkThemeAsset.php index d860d66..85ada9a 100644 --- a/DatepickerDarkThemeAsset.php +++ b/DatepickerDarkThemeAsset.php @@ -16,7 +16,6 @@ */ class DatepickerDarkThemeAsset extends AssetBundle { - public $sourcePath = '@bower/persian-datepicker/dist'; public $css = [ 'css/theme/persian-datepicker-dark.css', ]; @@ -26,4 +25,10 @@ class DatepickerDarkThemeAsset extends AssetBundle public $depends = [ 'mrlco\datepicker\DateAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } } diff --git a/DatepickerRedblackThemeAsset.php b/DatepickerRedblackThemeAsset.php index 3c4426f..cfdaf23 100644 --- a/DatepickerRedblackThemeAsset.php +++ b/DatepickerRedblackThemeAsset.php @@ -16,7 +16,6 @@ */ class DatepickerRedblackThemeAsset extends AssetBundle { - public $sourcePath = '@bower/persian-datepicker/dist'; public $css = [ 'css/theme/persian-datepicker-redblack.css', ]; @@ -26,4 +25,10 @@ class DatepickerRedblackThemeAsset extends AssetBundle public $depends = [ 'mrlco\datepicker\DateAsset', ]; + public function init() + { + $s = DIRECTORY_SEPARATOR; + $this->sourcePath = "@bower{$s}persian-date{$s}dist"; + parent::init(); + } }