How do I customize or localize my date formats in my emails and other liquid templates?

Option 1: You can provide date formats directly

Examples:

  • Date (DD/MM/YY, using custom date formats): {{ attributes["Supertime Delivery Date"] | date: '%d/%m/%Y' }}
  • Date (MM/DD/YY, using custom date formats): {{ attributes["Supertime Delivery Date"] | date: '%m/%d/%Y' }}

Option 2: Use a date format that is stored in your theme

Example:

Prerequisite: you must also set your store's language and region appropriately and also add the 'basic' format to your theme following the steps below.

Shopify requires you to provide your own localized date formatting where liquid files are used (like in order confirmation emails). So, in order to show Supertime dates in your desired date format, you'll need to update your theme's locales file. As mentioned earlier, the date format isn’t translated, so there’s also an option to create specific date formats inside a theme’s local settings, or to give the ability to change the date formatting from the theme editor.

Steps:

  1. Visit your Themes section
  2. Click Edit Code under the Actions drop-down menu
  3. Navigate to your theme’s locales/<your locale>.json  file where you would specify what date formats you want.

    Example: if you have English (New Zealand) as your locale, then you would want to use this file:
  4. Insert this entry into your json file (as a last entry would work):
"date_formats": {   
  "basic": "%d/%m/%Y" 
}

Now when you customize your order confirmations emails with Supertime details, you can localize your date format!

Here is an example of what it looks like when you've pasted the snippet into your locale file:


Steps (If you have date formats in your theme):

1. Visit your Themes section

2. Click Edit Languages under the Actions drop-down menu.

3. Click on the date formats tab.

4. Change the format to fit your needs (e.g. DD/MM/YY = %d/%m/%Y)

5. Click the Save button.

Now when you customize your order confirmations emails with Supertime details, you can localize your date format!