Custom field date uses different date format than the date format set in general settings


#1

I’ve made a custom field with “delivery date”
My date format is set to: dd.mm.yyy in the invoiceplane settings.
For the due date and invoice date, this works perfectly.
And if I download the PFD straight from invoiceplane when I’m in the invoice editor it also works.
BUT when I send an email out to a client, the PDF attached in the email displays the date format of my custom field as yyyy.mm.dd
When I use the guest link, it doesn’t show the custom field at all.
And when I hit “generate pdf” in the guest link, it also generates a pfd with the custom field date in the yyy.mm.dd format…
Anyone has an idea of how i can fix this? With the 2 date formats this looks confusing and unprofessional to clients…

I used the following code in my invoice template:
(leverdatum being my custom field which translates to delivery date)

<?php echo date_from_mysql($custom_fields['invoice']['Leverdatum']); ?>

42


#2

Hi,

Normally it should work.
What version are you on?
i tried replicating the issue and i got the date right.
Fresh install applied the 10-4-2018 in settings as date format.
Added custom field and your code to the template.


#3

Thanks for the report, added a ticket for this: https://development.invoiceplane.com/browse/IP-692


#4

Indeed it seems only with invoices in attachment.
To add delivery date to the guest url go to:
application -> views -> invoice temp -> public -> .php file
add the same line to show it.
Also it show the date correctly it is only on email invoices.


#5

I did test that and it is working correctly.

<?php echo $custom_fields['invoice']['Sent at']; ?>
returns
2018-07-18

and

<?php echo date_from_mysql($custom_fields['invoice']['Sent at']); ?>
returns
18.07.2018


#6

For me it still doesn’t work in the pdf attached to emails… It does work when you download it straight from invoiceplane or download it via the guestlink