Customising the date in your invoice templates

Subscribe to Customising the date in your invoice templates 2 post(s), 2 voice(s)

 
Avatar Bec 2 post(s)

Just thought I’d share how to customise the date display in your invoices e.g. “1 Jan 2008” instead of “01/01/2008” just in case anyone else wants to do this.

In your templates, instead of this:

{{ invoice.invoice_date | format_date }}

use this (but make the format string how you want it):

{{ invoice.invoice_date | date: "%e %b %Y" }}

Use the usual string date formatting codes e.g. http://au.php.net/strftime (Sorry for the PHP link; I didn’t know a RoR link and this is just a nice summary of the string formats!)

 
Avatar Seth - Subimage LLC Administrator 445 post(s)

Thanks for the tip! Making this a sticky…