added support for Ante meridiem and Post meridiem format (#615)

This commit is contained in:
Kevin Papst
2019-03-06 10:59:31 +01:00
committed by GitHub
parent e260dd84ad
commit 54cd30c564
14 changed files with 114 additions and 24 deletions

View File

@@ -111,6 +111,17 @@ class LocaleSettings
return $this->getConfigByLocaleAndKey('date', $locale);
}
/**
* Returns the locale specific time format, which should be used in combination with the twig filter "|time".
*
* @param null|string $locale
* @return string
*/
public function getTimeFormat(?string $locale = null): string
{
return $this->getConfigByLocaleAndKey('time', $locale);
}
/**
* Returns the locale specific datetime format, which should be used in combination with the twig filter "|date".
*
@@ -133,6 +144,17 @@ class LocaleSettings
return $this->getConfigByLocaleAndKey('duration', $locale);
}
/**
* Returns whether this locale uses the 24 hour format.
*
* @param null|string $locale
* @return bool
*/
public function isTwentyFourHours(?string $locale = null): bool
{
return $this->getConfigByLocaleAndKey('24_hours', $locale);
}
/**
* @param string $key
* @param null|string $locale