diff --git a/lib/private/L10N/L10N.php b/lib/private/L10N/L10N.php index 620c99dd1e..19db04a7cd 100644 --- a/lib/private/L10N/L10N.php +++ b/lib/private/L10N/L10N.php @@ -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; } diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php index 6d662efee2..703aa9e227 100644 --- a/tests/lib/L10N/L10nTest.php +++ b/tests/lib/L10N/L10nTest.php @@ -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'])); + } }