From acbcd26f3017dd3d73adcf6faa6597889c66334b Mon Sep 17 00:00:00 2001 From: rats4final Date: Mon, 12 Dec 2022 19:57:30 -0400 Subject: [PATCH] amo los bundlers --- package-lock.json | 11 +++++++ package.json | 1 + resources/css/app.css | 2 ++ resources/js/app.js | 12 ++++++++ resources/js/vanilla-datatables.js | 30 ++++++++++++++------ resources/views/admin/Citas/create.blade.php | 2 +- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb63504..ae75414 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "flatpickr": "^4.6.13", "simple-datatables": "^3.2.2" }, "devDependencies": { @@ -818,6 +819,11 @@ "node": ">=8" } }, + "node_modules/flatpickr": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", + "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==" + }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -2062,6 +2068,11 @@ "to-regex-range": "^5.0.1" } }, + "flatpickr": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", + "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==" + }, "follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", diff --git a/package.json b/package.json index 1c5506f..94ba2d2 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "vite": "^3.0.0" }, "dependencies": { + "flatpickr": "^4.6.13", "simple-datatables": "^3.2.2" } } diff --git a/resources/css/app.css b/resources/css/app.css index 84bc9e4..2410494 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,3 +1,5 @@ +@import "flatpickr/dist/flatpickr.min.css"; /*estilos del flatpickr*/ +@import "flatpickr/dist/themes/material_green.css"; @tailwind base; @tailwind components; @tailwind utilities; diff --git a/resources/js/app.js b/resources/js/app.js index d288579..9696cd0 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,2 +1,14 @@ /*jshint esversion: 6 */ import './bootstrap'; +import flatpickr from "flatpickr"; +import { Spanish } from "flatpickr/dist/l10n/es.js" + + +flatpickr("#myDate", { + "locale": Spanish, + enableTime: true, + dateFormat: "Y-m-d H:i", + minuteIncrement: 30, //XD + time_24hr: true, + weekNumbers: true, +}); \ No newline at end of file diff --git a/resources/js/vanilla-datatables.js b/resources/js/vanilla-datatables.js index 5110d76..5971eed 100644 --- a/resources/js/vanilla-datatables.js +++ b/resources/js/vanilla-datatables.js @@ -1,11 +1,23 @@ /*jshint esversion: 6 */ import {DataTable} from "simple-datatables"; -const dataTable = new DataTable("#myTable"); -document.querySelector("input.csv").addEventListener("click", () => { - dataTable.export({ - type:"csv", - download: true, - lineDelimiter: "\n\n", - columnDelimiter: ";" - }); -}); + + let tabla = document.getElementById('myTable'); + if (tabla) { + const dataTable = new DataTable('#myTable'); + } + + + + + // document.querySelector("input.csv").addEventListener("click", () => { + // dataTable.export({ + // type:"csv", + // download: true, + // lineDelimiter: "\n\n", + // columnDelimiter: ";" + // }); + // }); + + + + diff --git a/resources/views/admin/Citas/create.blade.php b/resources/views/admin/Citas/create.blade.php index 5021f4b..953506f 100644 --- a/resources/views/admin/Citas/create.blade.php +++ b/resources/views/admin/Citas/create.blade.php @@ -39,7 +39,7 @@
-
+
@error('fecha_cita') {{$message}} @enderror