Make L10N->l provide weekdayName
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
43147aeada
commit
e111da777a
2 changed files with 7 additions and 0 deletions
|
@ -169,6 +169,8 @@ class L10N implements IL10N {
|
|||
return (string) Calendar::formatDatetime($value, $width, $locale);
|
||||
case 'time':
|
||||
return (string) Calendar::formatTime($value, $width, $locale);
|
||||
case 'weekdayName':
|
||||
return (string) Calendar::getWeekdayName($value, $width, $locale);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -164,4 +164,9 @@ class L10nTest extends TestCase {
|
|||
$l = \OC::$server->getL10N('lib', 'de');
|
||||
$this->assertEquals('de', $l->getLanguageCode());
|
||||
}
|
||||
|
||||
public function testWeekdayName() {
|
||||
$l = \OC::$server->getL10N('lib', 'de');
|
||||
$this->assertEquals('Mo.', $l->l('weekdayName', new \DateTime('2017-11-6'), ['width' => 'abbreviated']));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue