Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
44 changes: 29 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"vite": "^7.1"
},
"dependencies": {
"@ryangjchandler/alpine-tooltip": "^2.0.1",
"bootstrap-icons": "^1.12.1",
"lucide-static": "^0.540.0"
}
Expand Down
1 change: 1 addition & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
3 changes: 3 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import './bootstrap';
import '../../vendor/masmerise/livewire-toaster/resources/js';
import Tooltip from "@ryangjchandler/alpine-tooltip";

Alpine.plugin(Tooltip);
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"base": "4.6.0",
"base": "4.2508",
"dev": false
}