diff --git a/app/helpers.php b/app/helpers.php index 9b91184a..cb2168f4 100755 --- a/app/helpers.php +++ b/app/helpers.php @@ -4,6 +4,7 @@ use App\Services\ModuleService; use App\Services\SettingsService; use App\Services\ViewIntegrationService; +use Illuminate\Support\Carbon; if (! function_exists('viewIntegration')) { function viewIntegration(): ViewIntegrationService @@ -40,3 +41,55 @@ function formatFileSize(int $bytes): string return $size.' '.$units[$power]; } } + +if (! function_exists('formatDateTime')) { + function formatDateTime($date, $format = null): string + { + if (blank($date)) { + return ''; + } + + if ($format) { + return Carbon::parse($date)->format($format); + } + + return Carbon::parse($date)->format(settings('internal.app.date_format', 'Y-m-d') . ' ' . settings('internal.app.time_format', 'H:i')); + } +} + +if (! function_exists('formatDate')) { + function formatDate($date, $format = null): string + { + if (blank($date)) { + return ''; + } + + if ($format) { + return Carbon::parse($date)->format($format); + } + + return Carbon::parse($date)->format(settings('internal.app.date_format', 'Y-m-d')); + } +} + +if (! function_exists('formatTime')) { + function formatTime(string $time, $format = null): string + { + if (blank($time)) { + return ''; + } + + if ($format) { + return Carbon::parse($time)->format($format); + } + + return Carbon::parse($time)->format(settings('internal.app.time_format', 'H:i')); + } +} + +if (! function_exists('carbon')) { + function carbon($time = null, $tz = null): Carbon + { + return new Carbon($time, $tz); + } +} diff --git a/package-lock.json b/package-lock.json index 02d7bb27..b78afce0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,10 +1,11 @@ { - "name": "html", + "name": "CyanFox-Base", "lockfileVersion": 3, "requires": true, "packages": { "": { "dependencies": { + "@ryangjchandler/alpine-tooltip": "^2.0.1", "bootstrap-icons": "^1.12.1", "lucide-static": "^0.540.0" }, @@ -523,6 +524,16 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.46.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.2.tgz", @@ -803,6 +814,14 @@ "win32" ] }, + "node_modules/@ryangjchandler/alpine-tooltip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@ryangjchandler/alpine-tooltip/-/alpine-tooltip-2.0.1.tgz", + "integrity": "sha512-Hv9C02bUE4JSewZhfceYSHw+oiBuUF3ITCMKqmiFWJ3bvjhHZzM8YEPpNQVMfEVRR4K4JJYJD16re4stGIjoyg==", + "dependencies": { + "tippy.js": "^6.3.1" + } + }, "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", @@ -840,13 +859,6 @@ "tailwindcss": "4.1.12" } }, - "node_modules/@tailwindcss/node/node_modules/tailwindcss": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz", - "integrity": "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==", - "dev": true, - "license": "MIT" - }, "node_modules/@tailwindcss/oxide": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.12.tgz", @@ -1167,13 +1179,6 @@ "tailwindcss": "4.1.12" } }, - "node_modules/@tailwindcss/postcss/node_modules/tailwindcss": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz", - "integrity": "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==", - "dev": true, - "license": "MIT" - }, "node_modules/@tailwindcss/typography": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz", @@ -2564,6 +2569,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/tippy.js": { + "version": "6.3.7", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", + "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", + "license": "MIT", + "dependencies": { + "@popperjs/core": "^2.9.0" + } + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", diff --git a/package.json b/package.json index 186a8443..5c36d626 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "vite": "^7.1" }, "dependencies": { + "@ryangjchandler/alpine-tooltip": "^2.0.1", "bootstrap-icons": "^1.12.1", "lucide-static": "^0.540.0" } diff --git a/resources/css/app.css b/resources/css/app.css index 0c11efb6..07e08b32 100755 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,6 +1,7 @@ @import 'tailwindcss'; @import 'bootstrap-icons/font/bootstrap-icons.css'; @import 'lucide-static/font/lucide.css'; +@import 'tippy.js/dist/tippy.css'; @config '../../tailwind.config.js'; /* Penguin UI Theme */ diff --git a/resources/js/app.js b/resources/js/app.js index b6223ea3..5a99295c 100755 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,2 +1,5 @@ import './bootstrap'; import '../../vendor/masmerise/livewire-toaster/resources/js'; +import Tooltip from "@ryangjchandler/alpine-tooltip"; + +Alpine.plugin(Tooltip); diff --git a/version.json b/version.json index 8ebc7e9a..2b637f35 100755 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "base": "4.6.0", + "base": "4.2508", "dev": false }