Bug ID: 21829
Summary: Date displays as a datetime in notices
Change sponsored?: ---
Priority: P5 - low
Assignee: [hidden email] Reporter: [hidden email] QA Contact: [hidden email]
The borrowers.dateexpiry field is a date, not a datetime, yet when it is used
in a notice like MEMBERSHIP_EXPIRY, it displays as a datetime by default with
the "12:00 AM" time ("MM/DD/YYYY 12:00 AM").
Bug 13622 added the option to strip times from datetimes by using a "dateonly"
placeholder like so: <<borrowers.dateexpiry | dateonly>>, but if you use this
option on borrowers.dateexpiry, it fails -- probably because the field is not a
<<borrowers.dateexpiry>> outputs "MM/DD/YYYY 12:00 AM".
<<borrowers.dateexpiry | dateonly>> outputs "<>" (a left-angle bracket followed
by right-angle bracket).
--- Comment #1 from Arturo <[hidden email]> ---
In looking at the HTML source of the generated e-mail notice, it's actually
just spitting out "<<borrowers.dateexpiry | dateonly>>" rather than "<>".
That's just how my browser and e-mail client displayed the output, assuming it
was an (invalid) HTML element.
--- Comment #5 from Arturo <[hidden email]> ---
Thanks for submitting this patch, Jonathan! I misunderstood your message to the
Koha mailing list and didn't realize this issue was fixed in 18.05.
Regardless, I hoped to test this patch and get it signed off, but since the
Koha sandboxes are limited and do not yet allow testing features that require a
cronjob, which the MEMBERSHIP_EXPIRY notice requires, I'm not able to.
--- Comment #6 from Arturo <[hidden email]> ---
My library was upgraded to Koha 18.05.05 a couple days ago, so I decided to try
using the "dateonly" option for borrowers.dateexpiry in my MEMBERSHIP_EXPIRY
notice, but I'm still seeing the same broken behavior. The generated e-mails
are not interpreting <<borrowers.dateexpiry | dateonly>> correctly and are just
spitting out that same string, which gets interpreted as an invalid HTML
element, so from the patron's point of view, the e-mail says "Your account will
expire on <>."
Thanks for your message! I was misunderstanding the already submitted patch.
You are correct -- I just confirmed that today's messages only use a date, not
a datetime, and all I have in the template is <<borrowers.dateexpiry>>. Problem
What |Removed |Added
CC| |[hidden email]
--- Comment #15 from Kyle M Hall <[hidden email]> ---
QA note, this bug was corrected by 17981 so these patches are not strictly
necessary. However, the addition of unit tests and a more 'standard' use of
dt_from_string make it's inclusion in Koha sensible.