Skip to content
Snippets Groups Projects
Unverified Commit e111da77 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

Make L10N->l provide weekdayName

parent 43147aea
No related branches found
No related tags found
No related merge requests found
...@@ -169,6 +169,8 @@ class L10N implements IL10N { ...@@ -169,6 +169,8 @@ class L10N implements IL10N {
return (string) Calendar::formatDatetime($value, $width, $locale); return (string) Calendar::formatDatetime($value, $width, $locale);
case 'time': case 'time':
return (string) Calendar::formatTime($value, $width, $locale); return (string) Calendar::formatTime($value, $width, $locale);
case 'weekdayName':
return (string) Calendar::getWeekdayName($value, $width, $locale);
default: default:
return false; return false;
} }
......
...@@ -164,4 +164,9 @@ class L10nTest extends TestCase { ...@@ -164,4 +164,9 @@ class L10nTest extends TestCase {
$l = \OC::$server->getL10N('lib', 'de'); $l = \OC::$server->getL10N('lib', 'de');
$this->assertEquals('de', $l->getLanguageCode()); $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']));
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment