Angularjs date filter ignores apostrophe

I would like to have a date formatted as here on SO: "Feb 6, '14."

I can not put an apostrophe there until the number 14.

I tried the following formatting strings:

{{model.since | date:'MMM d, \'yy'}}
{{model.since | date:'MMM d, 'yy'}}
{{model.since | date:"MMM d, 'yy"}}
{{model.since | date:"MMM d, 'yy"}}

Apostrophe is not displayed.

How can I put an apostrophe there?

+3
source share
1 answer

From the documentation for date :

To display a single quote, use two single quotes in the sequence (for example, "h 'o''clock").

, . , , .

, {{model.since | date:"MMM d, ''''yy"}}

+11

All Articles