mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
* Changed invoice date to datetime * Fixed code style errors * Update TimeFormatsController.php * Update TimeFormatter.php * Update TimeFormatsController namespace * Fix missing comma in language file * Fix formatting --------- Co-authored-by: troky <troky2001@yahoo.com>
35 lines
721 B
PHP
35 lines
721 B
PHP
<?php
|
|
|
|
namespace App\Space;
|
|
|
|
use Carbon\Carbon;
|
|
|
|
class TimeFormatter
|
|
{
|
|
protected static $formats = [
|
|
[
|
|
'carbon_format' => 'H:i',
|
|
'moment_format' => 'HH:mm',
|
|
],
|
|
[
|
|
'carbon_format' => 'g:i a',
|
|
'moment_format' => 'h:mm a',
|
|
],
|
|
];
|
|
|
|
public static function get_list()
|
|
{
|
|
$new = [];
|
|
|
|
foreach (static::$formats as $format) {
|
|
$new[] = [
|
|
'display_time' => Carbon::now()->format($format['carbon_format']),
|
|
'carbon_format_value' => $format['carbon_format'],
|
|
'moment_format_value' => $format['moment_format'],
|
|
];
|
|
}
|
|
|
|
return $new;
|
|
}
|
|
}
|