1

I'm trying to display the day of the week with the 12h time.

Sun 8:00 PM

This seems like a great task for the date pipe

{{myDate | date:'EEEE jm'}}

what gets displayed is

Sunday 8 PM0

the documentation for the pipe states that 'shortTime': equivalent to 'jm' (e.g. 12:05 PM for en-US)

basically I want the shortTime output with the weekday include.

Am I missing something?

1 Answer 1

1

That is really strange behaviour, {{myDate | date:'EEE jm'}} should work like a charm, I think it is Angular 2 bug. Until they fix that, you can use this as an temporary solution:

{{myDate | date:'EEE'}} {{myDate | date:'jm'}}

It displays date the way you want it, just tested it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.