From 6237b500ffb1717341c701caefafbf385ef010c7 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 17 Jul 2019 01:11:09 -0400 Subject: [PATCH] Replace pickadate with flatpickr so we can also pick time --- app/Dashboard.php | 2 +- gulpfile.js | 6 ++---- package-lock.json | 13 +++++-------- package.json | 2 +- resources/assets/js/dashboard.js | 8 ++------ 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/app/Dashboard.php b/app/Dashboard.php index aa7931b..cfca2a5 100644 --- a/app/Dashboard.php +++ b/app/Dashboard.php @@ -54,7 +54,7 @@ class Dashboard [ 'name' => 'GreenSock', 'url' => 'https://greensock.com/gsap' ], [ 'name' => 'jQuery', 'url' => 'https://jquery.org' ], [ 'name' => 'List.js', 'url' => 'http://listjs.com' ], - [ 'name' => 'pickadate.js', 'url' => 'http://amsul.ca/pickadate.js/' ], + [ 'name' => 'flatpickr', 'url' => 'https://flatpickr.js.org' ], [ 'name' => 'Popper.js', 'url' => 'https://popper.js.org' ], [ 'name' => 'SimpleMDE Markdown Editor', 'url' => 'https://simplemde.com' ], [ 'name' => 'Sortable', 'url' => 'https://github.com/RubaXa/Sortable' ], diff --git a/gulpfile.js b/gulpfile.js index aa258ea..8824979 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -61,8 +61,7 @@ const jsDashboardLibs = [ "node_modules/jquery/dist/jquery.js", "node_modules/popper.js/dist/umd/popper.js", "node_modules/bootstrap/dist/js/bootstrap.js", - "node_modules/pickadate/lib/picker.js", - "node_modules/pickadate/lib/picker.date.js", + "node_modules/flatpickr/dist/flatpickr.js", "bower_components/Sortable/Sortable.js", "bower_components/list.js/dist/list.js", "bower_components/simplemde/dist/simplemde.min.js" @@ -70,8 +69,7 @@ const jsDashboardLibs = [ // CSS libraries for the dashboard const cssDashboardLibs = [ - "node_modules/pickadate/lib/themes/default.css", - "node_modules/pickadate/lib/themes/default.date.css", + "node_modules/flatpickr/dist/flatpickr.css", "bower_components/simplemde/dist/simplemde.min.css", "bower_components/SpinKit/css/spinners/11-folding-cube.css" ]; diff --git a/package-lock.json b/package-lock.json index 262cb68..d16f0e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3254,6 +3254,11 @@ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==" }, + "flatpickr": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.2.tgz", + "integrity": "sha512-bRfBPyxohUQWgCTg6jPALUO1t/x+sRJ/S/RVti/NzYvHqGRpCAesKSWKLzOuLmpu+vGHfXBld4SXvOCLFgYb+g==" + }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -6160,14 +6165,6 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "pickadate": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/pickadate/-/pickadate-3.6.3.tgz", - "integrity": "sha512-UbYH4HptW6Mv4SHr/RaQLaHaawFU1HZD3jtS+uted+0bdUGzV5qUakUAZi+r5NTbnplJBqpOEg2MBg9IKcWPuQ==", - "requires": { - "jquery": ">=1.7" - } - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", diff --git a/package.json b/package.json index 06d0480..c93a82d 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "bootstrap": "4.3.1", "browserify": "^16.2.3", "fancy-log": "^1.3.3", + "flatpickr": "^4.6.2", "gsap": "^2.1.2", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", @@ -28,7 +29,6 @@ "gulp-uglify": "^3.0.2", "jquery": "^3.4.1", "minimist": "^1.2.0", - "pickadate": "^3.6.3", "popper.js": "^1.15.0", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0", diff --git a/resources/assets/js/dashboard.js b/resources/assets/js/dashboard.js index 5c48fa0..fe3920a 100644 --- a/resources/assets/js/dashboard.js +++ b/resources/assets/js/dashboard.js @@ -556,12 +556,8 @@ function editItemInit() { // enable the datepicker for each element with the date-picker class $datePickers.each(function() { - $(this).pickadate({ - format: "yyyy-mm-dd", - formatSubmit: "yyyy-mm-dd", - clear: false, - selectYears: true, - selectMonths: true + $(this).flatpickr({ + enableTime: true }); });