[Koha] Possible to customize date format in notices/slips?

Arturo Longoria Arturo.Longoria at sll.texas.gov
Wed Nov 14 06:54:23 NZDT 2018


Hi Jonathan,

Thanks for your reply! I’ve browsed the Letters.pm and DateUtils.pm (format_sqldatetime) code a bit, but I’m not clear on what the underlying issue might be! I’ve created a bug report describing the behavior I see in 17.11.10: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21829

Arturo Longoria
Reference Librarian/Web Manager
Texas State Law Library
www.sll.texas.gov

From: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Sent: Tuesday, November 13, 2018 09:26
To: Arturo Longoria <Arturo.Longoria at sll.texas.gov>
Cc: koha at lists.katipo.co.nz
Subject: Re: [Koha] Possible to customize date format in notices/slips?

I am not sure it's a regression actually.

in master it has been fixed by
commit a236b684fdae8e0da83ca7263b948da971dfc849
    Bug 17981: Add a preview mode for notice templates

modified: C4/Letters.pm
@ Letters.pm:887 @ sub _parseletter {
     my $values = $values_in ? { %$values_in } : {};

     if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
-        $values->{'dateexpiry'} = format_sqldatetime( $values->{'dateexpiry'} );
+        $values->{'dateexpiry'} = output_pref({ str => $values->{dateexpiry}, dateonly => 1 });
     }

     if ( $table eq 'reserves' && $values->{'waitingdate'} ) {

On Tue, 13 Nov 2018 at 12:21 Jonathan Druart <jonathan.druart at bugs.koha-community.org<mailto:jonathan.druart at bugs.koha-community.org>> wrote:
Hi Arturo,

I do recreate on 17.11.10, not master. Can you open a bug report?
You should not need to specify the dateonly filter for dateexpiry, it's automatically truncated to only display the date part (as there is no time part!)

Regards,
Jonathan

On Tue, 13 Nov 2018 at 11:14 Arturo Longoria <Arturo.Longoria at sll.texas.gov<mailto:Arturo.Longoria at sll.texas.gov>> wrote:
Thank you for your help, Katrin! As a follow up, I attempted to use the dateonly placeholder for our membership expiry notice, but the generated e-mails did not display as expected. In the notice, I used the following text exactly, with a space before and after the pipe character: "Your account will expire on <<borrowers.dateexpiry | dateonly>>." But the notices that were generated say: "Your account will expire on <>" (with an empty left and right angle brackets.

Our library is on Koha 17.11.10, and looking at the database schema, I see that the borrowers.dateexpiry column is "date", not "datetime", so that could be the reason why the dateonly placeholder doesn't work? But if that's the case, why is the "12:00 AM" added if the db column is a date, not a datetime?


Arturo Longoria
Reference Librarian/Web Manager
Texas State Law Library
www.sll.texas.gov<http://www.sll.texas.gov>

-----Original Message-----
From: Koha <koha-bounces at lists.katipo.co.nz<mailto:koha-bounces at lists.katipo.co.nz>> On Behalf Of Katrin Fischer
Sent: Friday, November 9, 2018 00:59
To: koha at lists.katipo.co.nz<mailto:koha at lists.katipo.co.nz>
Subject: Re: [Koha] Possible to customize date format in notices/slips?

Hi Arturo,

try adding | dateonly to your placeholder variable like this:

<< biblio.timestamp | dateonly >>

Hope this helps,

Katrin

On 07.11.18 15:46, Arturo Longoria wrote:
> Our library recently enabled the MEMBERSHIP_EXPIRY notice to alert patrons of expiring accounts. Currently, these notices display the expiration date along with a time (“Your account will expire on 12/06/2018 12:00 AM”), but is there a way to just display the date without the time? I read through the information on the wiki at https://wiki.koha-community.org/wiki/Customising_Notices_and_Slips as well as the manual, but I did not find any indication that the date format can be customized. I thought I’d check in with the list, though, to make sure I’m not missing anything.
>
> Thanks for any input you may have!
>
>
> Arturo Longoria
> Reference Librarian/Web Manager
> Texas State Law Library
> www.sll.texas.gov<http://www.sll.texas.gov><http://www.sll.texas.gov/>
>
> _______________________________________________
> Koha mailing list  http://koha-community.org Koha at lists.katipo.co.nz<mailto:Koha at lists.katipo.co.nz>
> https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list  http://koha-community.org Koha at lists.katipo.co.nz<mailto:Koha at lists.katipo.co.nz> https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list  http://koha-community.org
Koha at lists.katipo.co.nz<mailto:Koha at lists.katipo.co.nz>
https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list