Date formatted differently in template
-
The context of the site is ship model making. Each model is a pods custom post type. The model type has a field for a model maker (modeller), which is a pods custom taxonomy. The modeller taxonomy has a field for the user (so modellers are a subset of registered users).
In the template page for the model, I am attempting to write out the date the modeller joined (and potentially left) the club. I found the date format is dependent on the block that it is within.
[if modeller] <h3>by {@modeller} </h3> [each modeller] [if user] <p>Member since {@user.date_admitted}</p> [if user.date_admitted] [if user.date_resigned] <p>Member {@user.date_admitted} - {@user.date_resigned}</p> [else] <p>Member since {@user.date_admitted}</p> [/if] [/if] [/if] [/each] [/if]
results in
by John Doe Member since 2006 Member 2006-04-14 - 2019-11-21
The year alone is the format defined in the pod options and the preferred format for this template.
I attempted to resolve it by using an [each] loop for the user so that I could write just {@date_admitted} and see if that changed the formatting. But the [each] loop does not work at all.
[if modeller] <h3>by {@modeller} </h3> [each modeller] [if user] <p>Modeller user field is not null</p> [each user] <p>Beginning each user loop</p> [if date_admitted] [if date_resigned] <p>Member {@date_admitted} - {@date_resigned}</p> [else] <p>Member since {@date_admitted}</p> [/if] [/if] [/each] [else] <p>Modeller user field is null</p> [/if] [/each] [/if]
results in
by John Doe Modeller user field is not null
Am I doing something wrong? Can you change it so the specified formatting is displayed in all cases?
Thanks,
Greg
The page I need help with: [log in to see the link]
- The topic ‘Date formatted differently in template’ is closed to new replies.