mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +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
@@ -195,6 +195,12 @@ class Invoice extends Model implements HasMedia
|
||||
public function getFormattedInvoiceDateAttribute($value)
|
||||
{
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $this->company_id);
|
||||
$timeFormat = CompanySetting::getSetting('carbon_time_format', $this->company_id);
|
||||
$invoiceTimeEnabled = CompanySetting::getSetting('invoice_use_time', $this->company_id);
|
||||
|
||||
if ($invoiceTimeEnabled === 'YES') {
|
||||
$dateFormat .= ' '.$timeFormat;
|
||||
}
|
||||
|
||||
return Carbon::parse($this->invoice_date)->translatedFormat($dateFormat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user