FEATURE: add bootstrap datepicker. All elements with .date class are now datepicker holders

This commit is contained in:
Michal Kváček
2017-09-25 23:22:25 +02:00
parent 271e7f5170
commit c69bd9bcf7
7 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ trait Nullable {
* @return null|string
*/
public function nullableDate($date) {
return empty($date) ? null : Carbon::parse($date)->toDateTimeString();
return empty($date) ? null : Carbon::createFromFormat(config('app.date_format'), $date)->toDateTimeString();
}
/**
+3
View File
@@ -26,13 +26,16 @@ elixir (function (mix) {
'tinycolor/dist/tinycolor-min.js',
'chart.js/dist/Chart.bundle.min.js',
'jquery.are-you-sure/jquery.are-you-sure.js',
'../node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
'../resources/assets/admin/js/*.js',
], 'public/js/vendor.js', 'bower_components')
.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')
.sass (['bootstrap/bootstrap.scss'], 'public/css/admin/bootstrap.css')
.styles ([
'../../../public/css/admin/bootstrap.css',
'../../../public/css/bootstrap-datepicker.css',
'../../../bower_components/animate.css/animate.css',
], 'public/css/admin/style.css')
.remove ('public/css/admin/theme.scss');
+9 -2
View File
@@ -152,6 +152,14 @@
"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": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/bower/-/bower-1.8.0.tgz",
@@ -1761,8 +1769,7 @@
"jquery": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz",
"integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=",
"dev": true
"integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c="
},
"json-stable-stringify": {
"version": "1.0.1",
+1
View File
@@ -12,6 +12,7 @@
"lodash": "^4.16.2"
},
"dependencies": {
"bootstrap-datepicker": "^1.7.1",
"laravel-elixir-remove": "^0.2.1"
}
}
-1
View File
@@ -437,5 +437,4 @@ img {
white-space: nowrap;
background: none;
border: 0;
}
+4
View File
@@ -20,6 +20,10 @@ $ (document).ready (function () {
$ ('form').areYouSure ();
});
$ ('.date').datepicker ({
format: 'dd. mm. yyyy'
});
$ ('.checkbox').change (function () {
var e = $ (this);
var checked = e.is (':checked');
@@ -19,7 +19,7 @@
basicEntities: false,
entities_greek: false,
entities_latin: false,
height: 550,
height: {{$height or 550}},
removePlugins: 'about,scayt', //elementspath
extraPlugins: 'justify',
enterMode: CKEDITOR.ENTER_P,