Angular 5 - how to make the period field type lowercase in DatePipe
you can just split your date to 2 parts:
{{ today | date : 'EEEE, MMMM d, h:mm' }} {{ today | date : 'a' | lowercase }}
...............
UPDATE
Here is another simple way to achieve it, using built in date
pipe and aaaaa matcher (which returns lowercase a
or p
):
<div>{{ today | date : 'EEEE, MMMM d, h:mm aaaaa\'m\'' }}</div>
Updated Stackblitz: https://stackblitz.com/edit/angular-dcpgzb?file=app%2Fapp.component.html
...............
ANGULAR JS solution
app.controller('MainCtrl', function($scope, $locale) {
$locale.DATETIME_FORMATS.AMPMS = ['am', 'pm'];
$scope.today = new Date();
});
https://plnkr.co/edit/a49kjvOdifXPAvBlmXEi?p=preview