Skip to content

Commit

Permalink
feat: date helper (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
64knl authored Jan 31, 2024
1 parent e7a302f commit 59077b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Helpers/SitebossHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static function config(string $code, bool $failOnMissing = true): string|

public static function mail(string $to_name, string $to_email, string $subject, $html, $data = false): ?int
{
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
$sendgrid_api_key = self::config('sendgrid_api_key', true);
$sendgrid_sender_email = self::config('sendgrid_sender_email', true);
$sendgrid_sender_name = self::config('sendgrid_sender_name', true);
Expand Down Expand Up @@ -111,4 +112,13 @@ public static function makeDirectory($root, $dir): bool

return true;
}

public static function formatDate($date): string
{
if (is_null($date)) {
return '-';
}

return date('d-m-Y H:i:s', strtotime($date));
}
}

0 comments on commit 59077b3

Please sign in to comment.