lomixture Posted July 21, 2022 Share Posted July 21, 2022 Hi all Is there a way of changing the date format on a custom field in an email template? As you can see from the screengrab, we are using hcustom fields to pull data from a request, but our teams are complaining its in the American format and it is confusing things. I've dug about but couldn't find a logical way of changing this, any ideas appreciated. Link to comment Share on other sites More sharing options...
Victor Posted July 21, 2022 Share Posted July 21, 2022 @lokent use "formatlocaltime" parameter on variable. Works only on date/time custom fields. 1 Link to comment Share on other sites More sharing options...
lomixture Posted July 22, 2022 Author Share Posted July 22, 2022 Victor, I tried to input this as the format {{h.custom_s}|formatlocaltime}} however it stopped any info being pulled through to the template. Please could you clarify what format this should be input in? Link to comment Share on other sites More sharing options...
lomixture Posted July 22, 2022 Author Share Posted July 22, 2022 Ah, I need to remove the single } in the middle? Link to comment Share on other sites More sharing options...
Steve Giller Posted July 22, 2022 Share Posted July 22, 2022 11 minutes ago, lokent said: Ah, I need to remove the single } in the middle? Yes, and use a Date/Time field (h_custom_21 - h_custom_25) Link to comment Share on other sites More sharing options...
lomixture Posted July 27, 2022 Author Share Posted July 27, 2022 It didn't work! I tried three different iterations and every time it either left the email form with a blank or only pulled through the format not the actual info. Would someone be able to tell me what the format should look like if this is what it currently reads? Currently it says: My leaving date will be {{.H_custom_s}} I have tried the following: {{.H_custom_s}|formatlocaltime}} (this pulls through nothing) {{.H_custom_s|formatLocalTime}} (this just pulls through the blank code) Link to comment Share on other sites More sharing options...
lomixture Posted July 27, 2022 Author Share Posted July 27, 2022 Oh @Steve Giller- I think I've just realised what you're saying. I need to change the lettered custom field for a numbered custom field? Link to comment Share on other sites More sharing options...
Steve Giller Posted July 27, 2022 Share Posted July 27, 2022 @lokentSpecifically h_custom_21 - h_custom_25 h_custom_26 and higher are not Date/Time fields. 1 Link to comment Share on other sites More sharing options...
Victor Posted July 27, 2022 Share Posted July 27, 2022 @lokent have a look at the documentation for mapping custom fields (link below). Any field that is if type DATETIME can be formatted for localtime and only this type of fields can be formatted with localtime. https://wiki.hornbill.com/index.php?title=Mapping_Fields_from_Customised_Forms Link to comment Share on other sites More sharing options...
lomixture Posted July 28, 2022 Author Share Posted July 28, 2022 @Victor thank you, good for reference in the future. Changing to the custom25 field worked a treat Link to comment Share on other sites More sharing options...
Guest Paul Alexander Posted September 22, 2022 Share Posted September 22, 2022 Just hijacking this thread for a bit! Is there a way of converting the .fixby date field to a different date format in an email template? I understand that I could add the .fixby information to a date/time custom field and then use that with the |formatLocalTime switch, but I don't want to have to do that to all of our Incident processes! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now