I have a small problem with a custom field.
I have set the style for dates as d-m-y but when I add a custom field type Date it returns y-m-d.
Is there already a way to change this that I’m overseeing?
I don’t mind changing it in the code itself but would appreciate a pointer to the right file!
Hm … I may have to pass on this one, as I never really used custom fields in combination with dates.
But if the formating of the date/output does not meet your requirements you can easily change this with PHP with something like this:
Short:
read the actuall output, and give the actuall formating
convert string to timestamp
convert timestamp to date in the desired format
Sorry to say so, but in this speciall case I not not have enough experience so this workaround is all I can give you here.
Hoffe Du erreichst mit diesem kleine Workaround, was gewünscht war
thank you for your help @M4rt1n! While trying to implement the workaround I’ve found an easy solution. Posting this for anyone, who runs into this problem as well.
If you have a custom date field, change the code from: <?php echo $custom_fields['invoice']['my_custom_field']); ?>
to: <?php echo date_from_mysql($custom_fields['invoice']['my_custom_field'], true); ?>
That way you make sure your date is formatted correctly!