FEATURE: add bootstrap datepicker. All elements with .date class are now datepicker holders
This commit is contained in:
@@ -17,7 +17,7 @@ trait Nullable {
|
|||||||
* @return null|string
|
* @return null|string
|
||||||
*/
|
*/
|
||||||
public function nullableDate($date) {
|
public function nullableDate($date) {
|
||||||
return empty($date) ? null : Carbon::parse($date)->toDateTimeString();
|
return empty($date) ? null : Carbon::createFromFormat(config('app.date_format'), $date)->toDateTimeString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,13 +26,16 @@ elixir (function (mix) {
|
|||||||
'tinycolor/dist/tinycolor-min.js',
|
'tinycolor/dist/tinycolor-min.js',
|
||||||
'chart.js/dist/Chart.bundle.min.js',
|
'chart.js/dist/Chart.bundle.min.js',
|
||||||
'jquery.are-you-sure/jquery.are-you-sure.js',
|
'jquery.are-you-sure/jquery.are-you-sure.js',
|
||||||
|
'../node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
|
||||||
'../resources/assets/admin/js/*.js',
|
'../resources/assets/admin/js/*.js',
|
||||||
], 'public/js/vendor.js', 'bower_components')
|
], 'public/js/vendor.js', 'bower_components')
|
||||||
.copy ('bower_components/font-awesome/css/font-awesome.min.css', 'public/css')
|
.copy ('bower_components/font-awesome/css/font-awesome.min.css', 'public/css')
|
||||||
|
.copy ('node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css', 'public/css')
|
||||||
.copy ('bower_components/font-awesome/fonts', 'public/fonts')
|
.copy ('bower_components/font-awesome/fonts', 'public/fonts')
|
||||||
.sass (['bootstrap/bootstrap.scss'], 'public/css/admin/bootstrap.css')
|
.sass (['bootstrap/bootstrap.scss'], 'public/css/admin/bootstrap.css')
|
||||||
.styles ([
|
.styles ([
|
||||||
'../../../public/css/admin/bootstrap.css',
|
'../../../public/css/admin/bootstrap.css',
|
||||||
|
'../../../public/css/bootstrap-datepicker.css',
|
||||||
'../../../bower_components/animate.css/animate.css',
|
'../../../bower_components/animate.css/animate.css',
|
||||||
], 'public/css/admin/style.css')
|
], 'public/css/admin/style.css')
|
||||||
.remove ('public/css/admin/theme.scss');
|
.remove ('public/css/admin/theme.scss');
|
||||||
|
|||||||
Generated
+9
-2
@@ -152,6 +152,14 @@
|
|||||||
"inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
|
"inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bootstrap-datepicker": {
|
||||||
|
"version": "1.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.7.1.tgz",
|
||||||
|
"integrity": "sha1-Tuf680iI2+x4NPv52+fEJ34B3a8=",
|
||||||
|
"requires": {
|
||||||
|
"jquery": "3.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"bower": {
|
"bower": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/bower/-/bower-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/bower/-/bower-1.8.0.tgz",
|
||||||
@@ -1761,8 +1769,7 @@
|
|||||||
"jquery": {
|
"jquery": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz",
|
||||||
"integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=",
|
"integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"json-stable-stringify": {
|
"json-stable-stringify": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"lodash": "^4.16.2"
|
"lodash": "^4.16.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"bootstrap-datepicker": "^1.7.1",
|
||||||
"laravel-elixir-remove": "^0.2.1"
|
"laravel-elixir-remove": "^0.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -437,5 +437,4 @@ img {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
background: none;
|
background: none;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,10 @@ $ (document).ready (function () {
|
|||||||
$ ('form').areYouSure ();
|
$ ('form').areYouSure ();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$ ('.date').datepicker ({
|
||||||
|
format: 'dd. mm. yyyy'
|
||||||
|
});
|
||||||
|
|
||||||
$ ('.checkbox').change (function () {
|
$ ('.checkbox').change (function () {
|
||||||
var e = $ (this);
|
var e = $ (this);
|
||||||
var checked = e.is (':checked');
|
var checked = e.is (':checked');
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
basicEntities: false,
|
basicEntities: false,
|
||||||
entities_greek: false,
|
entities_greek: false,
|
||||||
entities_latin: false,
|
entities_latin: false,
|
||||||
height: 550,
|
height: {{$height or 550}},
|
||||||
removePlugins: 'about,scayt', //elementspath
|
removePlugins: 'about,scayt', //elementspath
|
||||||
extraPlugins: 'justify',
|
extraPlugins: 'justify',
|
||||||
enterMode: CKEDITOR.ENTER_P,
|
enterMode: CKEDITOR.ENTER_P,
|
||||||
|
|||||||
Reference in New Issue
Block a user