From f1b535e4d7ddf3d309ccb6201d14e8c1091b867a Mon Sep 17 00:00:00 2001 From: yarik Date: Tue, 27 Dec 2016 17:36:15 +0200 Subject: [PATCH] Datepicker --- frontend/controllers/CabinetController.php | 5 +++++ frontend/views/layouts/cabinet.php | 72 ------------------------------------------------------------------------ frontend/web/js/script.js | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 72 deletions(-) diff --git a/frontend/controllers/CabinetController.php b/frontend/controllers/CabinetController.php index a61111b..08ce1db 100644 --- a/frontend/controllers/CabinetController.php +++ b/frontend/controllers/CabinetController.php @@ -55,6 +55,11 @@ ]); } + public function actionSales() + { + + } + public function actionPersonal() { $request = \Yii::$app->request; diff --git a/frontend/views/layouts/cabinet.php b/frontend/views/layouts/cabinet.php index 07c70d6..6ad99ce 100644 --- a/frontend/views/layouts/cabinet.php +++ b/frontend/views/layouts/cabinet.php @@ -259,77 +259,5 @@ EOT; Видалити registerJs($js); -?> -endContent(); ?> diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 084bd92..dc8afe2 100644 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -2,6 +2,7 @@ $(document).ready(function(){ footer(); cabinet(); formsHome(); + initDatePicker(); function footer(){ footerBottom(); @@ -151,6 +152,80 @@ $(document).ready(function(){ return false; }); + $(document).on('pjax:complete', function() { + initDatePicker(); + }); + + function initDatePicker() { + $('._datepicer, ._datepicker') + .datepicker( + { + changeMonth: true, + changeYear: true, + dateFormat: 'dd.mm.yy', + closeText: 'Закрыть', + prevText: 'Пред', + nextText: 'След', + monthNames: [ + 'Январь', + 'Февраль', + 'Март', + 'Апрель', + 'Май', + 'Июнь', + 'Июль', + 'Август', + 'Сентябрь', + 'Октябрь', + 'Ноябрь', + 'Декабрь' + ], + monthNamesShort: [ + 'Январь', + 'Февраль', + 'Март', + 'Апрель', + 'Май', + 'Июнь', + 'Июль', + 'Август', + 'Сентябрь', + 'Октябрь', + 'Ноябрь', + 'Декабрь' + ], + dayNames: [ + 'воскресенье', + 'понедельник', + 'вторник', + 'среда', + 'четверг', + 'пятница', + 'суббота' + ], + dayNamesShort: [ + 'вск', + 'пнд', + 'втр', + 'срд', + 'чтв', + 'птн', + 'сбт' + ], + dayNamesMin: [ + 'Вс', + 'Пн', + 'Вт', + 'Ср', + 'Чт', + 'Пт', + 'Сб' + ], + firstDay: 1 + } + ); + } + function postForm(context) { $.post($(context).attr('action'), $(context).serialize(), function(data) { var type; -- libgit2 0.21.4