mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
Invoice time support (#269)
* 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>
This commit is contained in:
committed by
GitHub
parent
32e03b98a3
commit
f52b73f517
34
app/Space/TimeFormatter.php
Normal file
34
app/Space/TimeFormatter.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user