Make L10N->l provide weekdayName
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
43147aeada
commit
e111da777a
|
@ -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 {
|
||||||
$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']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue