Discussion:
[Koha] Possible to customize date format in notices/slips?
Arturo Longoria
2018-11-07 14:46:39 UTC
Permalink
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/>
Katrin Fischer
2018-11-09 06:58:38 UTC
Permalink
Hi Arturo,

try adding | dateonly to your placeholder variable like this:

<< biblio.timestamp | dateonly >>

Hope this helps,

Katrin
Post by Arturo Longoria
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/>
_______________________________________________
Koha mailing list http://koha-community.org
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz
https://lists.katipo.co.nz/
Arturo Longoria
2018-11-13 14:14:11 UTC
Permalink
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

-----Original Message-----
From: Koha <koha-***@lists.katipo.co.nz> On Behalf Of Katrin Fischer
Sent: Friday, November 9, 2018 00:59
To: ***@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
Post by Arturo Longoria
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/>
_______________________________________________
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz
https://lists.katipo.co.
Arturo Longoria
2018-11-13 17:54:23 UTC
Permalink
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 <***@bugs.koha-community.org>
Sent: Tuesday, November 13, 2018 09:26
To: Arturo Longoria <***@sll.texas.gov>
Cc: ***@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 <***@bugs.koha-community.org<mailto:***@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 <***@sll.texas.gov<mailto:***@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-***@lists.katipo.co.nz<mailto:koha-***@lists.katipo.co.nz>> On Behalf Of Katrin Fischer
Sent: Friday, November 9, 2018 00:59
To: ***@lists.katipo.co.nz<mailto:***@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
Post by Arturo Longoria
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/>
_______________________________________________
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz> https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz>
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman
Arturo Longoria
2018-11-19 14:20:54 UTC
Permalink
Hi Jonathan,

Our library was upgraded to Koha 18.05.05 this weekend, so I went back and added the “dateonly” placeholder for the borrowers.dateexpiry field in a notice, but I still see the same issue. Koha does not interpret it correctly and instead just outputs “<<borrowers.dateexpiry | dateonly>>” in the e-mail, which gets interpreted as an invalid HTML element. So unless I’m using it incorrectly, I’m not sure it was fixed by bug 17981? I’ll update the bug to document what I saw: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21829

Arturo

From: Jonathan Druart <***@bugs.koha-community.org>
Sent: Tuesday, November 13, 2018 09:26
To: Arturo Longoria <***@sll.texas.gov>
Cc: ***@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 <***@bugs.koha-community.org<mailto:***@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 <***@sll.texas.gov<mailto:***@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-***@lists.katipo.co.nz<mailto:koha-***@lists.katipo.co.nz>> On Behalf Of Katrin Fischer
Sent: Friday, November 9, 2018 00:59
To: ***@lists.katipo.co.nz<mailto:***@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
Post by Arturo Longoria
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/>
_______________________________________________
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz> https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz>
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/l
Arturo Longoria
2018-11-20 16:55:07 UTC
Permalink
One final update in case someone else stumbles upon this thread: my problem was using "dateonly" in Koha 18.05. The underlying bug of a date (borrowers.dateexpiry) appearing as a datetime was fixed for 18.05, so there was no need to use the "dateonly" placeholder any longer, as I'd attempted. Simply using <<borrowers.dateexpiry>> in 18.05 works as expected without the "12:00 A.M." time.


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

-----Original Message-----
From: Koha <koha-***@lists.katipo.co.nz> On Behalf Of Arturo Longoria
Sent: Monday, November 19, 2018 08:21
To: Jonathan Druart <***@bugs.koha-community.org>
Cc: ***@lists.katipo.co.nz
Subject: Re: [Koha] Possible to customize date format in notices/slips?

Hi Jonathan,

Our library was upgraded to Koha 18.05.05 this weekend, so I went back and added the “dateonly” placeholder for the borrowers.dateexpiry field in a notice, but I still see the same issue. Koha does not interpret it correctly and instead just outputs “<<borrowers.dateexpiry | dateonly>>” in the e-mail, which gets interpreted as an invalid HTML element. So unless I’m using it incorrectly, I’m not sure it was fixed by bug 17981? I’ll update the bug to document what I saw: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21829

Arturo

From: Jonathan Druart <***@bugs.koha-community.org>
Sent: Tuesday, November 13, 2018 09:26
To: Arturo Longoria <***@sll.texas.gov>
Cc: ***@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 <***@bugs.koha-community.org<mailto:***@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 <***@sll.texas.gov<mailto:***@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-***@lists.katipo.co.nz<mailto:koha-***@lists.katipo.co.nz>> On Behalf Of Katrin Fischer
Sent: Friday, November 9, 2018 00:59
To: ***@lists.katipo.co.nz<mailto:***@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
Post by Arturo Longoria
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
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz> https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz<mailto:***@lists.katipo.co.nz>
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org ***@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
***@lists.katipo.co.nz
https://lists.katipo.co.nz/mai

Loading...