Chart field name refactor

This commit is contained in:
James Cole
2023-08-01 10:26:26 +02:00
parent 3517452ea1
commit 7c9f7f04b7
4 changed files with 18 additions and 40 deletions

View File

@@ -559,25 +559,6 @@ class Navigation
return $format;
}
/**
* Same as preferredCarbonLocalizedFormat but based on the period.
*
* @param string $period
*
* @return string
*/
public function preferredCarbonLocalizedFormatByPeriod(string $period): string
{
$locale = app('steam')->getLocale();
return match ($period) {
default => (string)trans('config.month_and_day_js', [], $locale),
'1W' => (string)trans('config.week_in_year_js', [], $locale),
'1M' => (string)trans('config.month_js', [], $locale),
'3M', '6M' => (string)trans('config.half_year_js', [], $locale),
'1Y' => (string)trans('config.year_js', [], $locale),
};
}
/**
* If the date difference between start and end is less than a month, method returns "endOfDay". If the difference
* is less than a year, method returns "endOfMonth". If the date difference is larger, method returns "endOfYear".