[OPEN-ILS-GENERAL] Date format for the Hold "If suspended, activate on"

Josh Stompro stomproj at gsuite.larl.org
Fri Aug 23 10:48:16 EDT 2019

Hello Eva, it looks like it would be possible to edit the date hint in the
edit.tt2 template
and in the place_hold.tt2 template

And then in EGCatLoader/Account.pm change the regular expression that
parses the date out to match the format you use.

        # TODO: Make this support other date formats, not just mm/dd/yyyy.
        # We should use a date input type on the forms once it is
supported by Firefox.
        # I didn't do that now because it is not available in a general release.
        if ($cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
            eval {
                my $dt = DateTime::Format::ISO8601->parse_datetime("$3-$1-$2");
                $ctx->{thaw_date} = $dt->ymd;
            if ($@) {
                $logger->warn("ignoring invalid thaw_date when placing
hold request");

Also, see bug https://bugs.launchpad.net/evergreen/+bug/1189989 which
discusses the date issue at length.  At that time (2 years ago, aug 2017)
the firefox date form element wasn't available, but now it is in both the
release and ESR versions.  So you may want to try changing the input type
to date, and then updating the regular expressions to support the
YYYY-MM-DD format that the date input type sends.  That would get you the
benefits of localized format and a date picker widget.  Maybe it is time to
update the feature to support the date form element also?

Reference: Suspend at time of placement feature commit:


On Mon, Aug 19, 2019 at 8:32 AM Cerninakova Eva <cernin at jabok.cz> wrote:

> Hi,
> in Holds screen in My account in the OPAC, it is possible to enter the
> date for the "If suspended, activate on" and "Cancel unless filled by"
> only in the MM/DD/YYYY format (no matter what date formats for the OPAC
> are set up in config.tt2 and header.tt2).
> This date  format is not used in Czech at all and the day and month are
> always used in reverse order too, so it is very confusing for our users .
> In addition, when the date has been inserted in the format other than  the
> one specified above, the action fails silently (without any error message).
> Can someone please advise me how to change the date format for the hold "If
> suspended, activate on" and "Cancel unless filled by" ?
> Thanks for any idea
> Eva
> ---
> Mgr. Eva Cerniňáková
> cernin at jabok.cz
> Tel. +420 211 222 409
> Knihovna Jabok
> http:/knihovna.jabok.cz
> Tel.  +420 211 222 410
> Jabok - Vyšší odborná škola sociálně pedagogická a teologická
> Salmovská 8, 120 00 Praha 2
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Bez
> virů. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#m_-7805326569781748773_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Josh Stompro - IT Director
Lake Agassiz Regional Library
Desk: 218-233-3757 Ext 139
Cell: 218-790-2110
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20190823/295a2279/attachment-0001.html>

More information about the Open-ils-general mailing list