Liquid date filter no longer working with ISO formatted dates

The date filter seems to have changed and is no longer recognizing ISO formatted dates.

For example, this:

{{ p.last | date: '%m/%d/%y %-I:%M %p' }}

Would output 03/16/2019 5:30 pm when p.last is ‘2019-03-16T17:30’:

If you capture p.last separately then it will display the date correctly:

{% capture test %}{{ p.last }}{% endcapture %}
{{ test | date: '%m/%d/%y %-I:%M %p' }}

We have thousands of shops using this so it would be great if could work as before.

Thanks, Gavin.

An example of where it breaks: https://charleston.classesbykessler.com/collections/classes/products/wine-blending

Add that to the cart and the date/time is not formatted correctly.

Hi, Gavin.

Katy here from Shopify! I know we had spoken a little about this earlier via our support channels. Thank you for bringing this to our attention. I can confirm that our technical team are actively reviewing this for you at this time.

I would like to leave the thread open, just for any of our community members who may like to chime in. Or, if any of our members have noticed something similar on their own store please feel free to reach out to us directly. You can do so via phone, chat, email or social media.

Thank you!

Katy

Converting times has also stopped working:

{{ p.last | date: '%-I:%M %p' }}

This would previously turn ‘14:00’ into ‘2 pm’.

Thanks, Gavin.

The date format should be not military time. please change back.

Hey Katy,

Sam here from the Store Pickup + Delivery app, I have 7 stores having the same issue, do you have an update from the technical team on this?

Thanks,

Sam

Hey everyone,

Bo here from Shopify Support helping out!

I was just speaking with our technical team and they have let me know that this issue has now been resolved. If you could please clear your cache and try again this should work as expected. If you are still experiencing any issues with this, please do let us know. We really appreciate you all bringing this to our attention and apologize for any inconvenience caused.

All the Best,

Bo

2 Likes

I’m using {{ p.last | date: ‘%m/%d/%y %-I:%M %p’ }} in the order confirmation email, and want to remove the time from the end of it.

How do I achieve this? I’ve tried removing %-I:%M %p but then in the email it shows “Liquid error: argument out of range”.