Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{{ now|date('A a') }} not formatting as expected #3007

Closed
lewisjenkins opened this issue Jun 19, 2018 · 0 comments
Closed

{{ now|date('A a') }} not formatting as expected #3007

lewisjenkins opened this issue Jun 19, 2018 · 0 comments

Comments

@lewisjenkins
Copy link

Description

If I do then I get PM which is the expected output.

But if I do {{ now|date('A') }} on the same website then I'm getting p.m. (PM changes to p.m.)

According to the Twig manual, the format specifier is the same as supported by PHP date function.

Therefore, I should be able to use either of the following:

a = Lowercase Ante meridiem and Post meridiem (am or pm)
A = Uppercase Ante meridiem and Post meridiem (AM or PM)

However, in Craft, using either a or A in Twig has the same result - a.m. or p.m. - in lowercase with added periods.

Steps to reproduce

  1. Output of = AM am
  2. Output of {{ now|date('A a') }} = a.m. a.m.
  3. Results are not identical

Additional info

  • Craft version: 3.0.12
  • PHP version: 7.0.30-0ubuntu0.16.04.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant