|
@@ -3,6 +3,7 @@
|
3
|
3
|
namespace App\Services;
|
4
|
4
|
|
5
|
5
|
use App\Enums\Setting\DateFormat;
|
|
6
|
+use App\Enums\Setting\TimeFormat;
|
6
|
7
|
use App\Enums\Setting\WeekStart;
|
7
|
8
|
use App\Models\Company;
|
8
|
9
|
use App\Models\Setting\Currency;
|
|
@@ -43,6 +44,7 @@ class CompanySettingsService
|
43
|
44
|
'default_timezone' => $company->locale->timezone ?? config('app.timezone'),
|
44
|
45
|
'default_currency' => $defaultCurrency,
|
45
|
46
|
'default_date_format' => $company->locale->date_format->value ?? DateFormat::DEFAULT,
|
|
47
|
+ 'default_time_format' => $company->locale->time_format->value ?? TimeFormat::DEFAULT,
|
46
|
48
|
'default_week_start' => $company->locale->week_start->value ?? WeekStart::DEFAULT,
|
47
|
49
|
];
|
48
|
50
|
});
|
|
@@ -68,6 +70,7 @@ class CompanySettingsService
|
68
|
70
|
'default_timezone' => config('app.timezone'),
|
69
|
71
|
'default_currency' => 'USD',
|
70
|
72
|
'default_date_format' => DateFormat::DEFAULT,
|
|
73
|
+ 'default_time_format' => TimeFormat::DEFAULT,
|
71
|
74
|
'default_week_start' => WeekStart::DEFAULT,
|
72
|
75
|
];
|
73
|
76
|
}
|
|
@@ -103,4 +106,14 @@ class CompanySettingsService
|
103
|
106
|
{
|
104
|
107
|
return self::getSpecificSetting($companyId, 'default_week_start', WeekStart::DEFAULT);
|
105
|
108
|
}
|
|
109
|
+
|
|
110
|
+ public static function getDefaultTimeFormat(?int $companyId = null): string
|
|
111
|
+ {
|
|
112
|
+ return self::getSpecificSetting($companyId, 'default_time_format', TimeFormat::DEFAULT);
|
|
113
|
+ }
|
|
114
|
+
|
|
115
|
+ public static function getDefaultDateTimeFormat(?int $companyId = null): string
|
|
116
|
+ {
|
|
117
|
+ return self::getDefaultDateFormat($companyId) . ' ' . self::getDefaultTimeFormat($companyId);
|
|
118
|
+ }
|
106
|
119
|
}
|