<@UDP12QEQL> you can do it by converting both date...
# advancedpdf
m
@MikeERPG you can do it by converting both dates to longs.. something like
(.now?long - transaction.duedate?long) * 1000 * 60 * 60 * 24
k
heya @michoel We have tried this but the email template freemarker doesnt like it at all.
Also the duedate field comes back in the format of 1, May 2019
we dont sem to be able to convert it to a proper datetime
m
I just tried and realized I mixed up my multiply and divide
This expression is working for me:
${((.now?long - transaction.duedate?long) / (1000 * 60 * 60 * 24))?floor}
m
We just keep getting this error 😞
m
Wierd it works for me on an invoice email. Does just
${transaction.duedate?long}
give you that error
k
Yes that's the one. Now works no problem.
I was wondering if it was due to date preferences.
m
Maybe
transaction.duedate?date("<your date format>")?long
k
I'll try that tomorrow. It's just mighty odd that what you use doesnt work.
m
message has been deleted
message has been deleted
k
Thanks @michoel This works when previewing an email but when going to send we get the error above that @MikeERPG mentioned. Don’t see why when previewing it’s fine but then we get the error when trying to send.
m
Wow strange, I never tested sending an email. Sound like a defect to me in that case.