KohaDates filter questions...
Greetings, I was looking at a bug, and I thought to myself, “What if I wanted the time stamp portion of included in this column, and not just a date?”. I ran: grep '| \$KohaDates with' `find . -name "*.tt" | grep "\/en\/"` just to see how others had done it. Well, initially without the with, and then with the with, because obviously I found the examples. ./koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt: <td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt: ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt: <td><span title="[% batch_lis.staged_date %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt: on <span title="[% timestamp | $KohaDates with_hours = 1 %]"> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt: on <span title="[% timestamp | $KohaDates with_hours = 1%]"> Is it supposed to be ‘=>’ or ‘=’? Does it matter? What is our standard? Should we have one? GPML, Mark Tompsett
From the TT manual: Named parameters can be specified using either => or = and can appear anywhere in the argument list. Hard to find that btw .. So both seem to be fine. Marcel Van: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel-bounces@lists.koha-community.org] Namens Mark Tompsett Verzonden: zondag 30 maart 2014 4:06 Aan: koha-devel@lists.koha-community.org Onderwerp: [Koha-devel] KohaDates filter questions... Greetings, I was looking at a bug, and I thought to myself, “What if I wanted the time stamp portion of included in this column, and not just a date?”. I ran: grep '| \$KohaDates with' `find . -name "*.tt" | grep "\/en\/"` just to see how others had done it. Well, initially without the with, and then with the with, because obviously I found the examples. [Smile] ./koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt: <td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt: ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt: <td><span title="[% batch_lis.staged_date %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt: on <span title="[% timestamp | $KohaDates with_hours = 1 %]"> ./koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt: on <span title="[% timestamp | $KohaDates with_hours = 1%]"> Is it supposed to be ‘=>’ or ‘=’? Does it matter? What is our standard? Should we have one? GPML, Mark Tompsett
Greetings, I initially asked:
Is it supposed to be ‘=>’ or ‘=’ [for named parameters]? Does it matter? What is our standard? Should we have one?
Marcel de Rooy replied:
From the TT manual: Named parameters can be specified using either => or = and can appear anywhere in the argument list.
Hard to find that btw ..
So both seem to be fine.
Glad to hear that either way works, but shouldn’t we aim for consistency? Should we not suggest a standard, even if we don’t enforce it? GPML, Mark Tompsett
+1 for adding it to coding conventions. Le 31/03/2014 16:49, Mark Tompsett a écrit :
Greetings,
I initially asked:
Is it supposed to be ‘=>’ or ‘=’ [for named parameters]? Does it matter? What is our standard? Should we have one?
Marcel de Rooy replied:
From the TT manual: Named parameters can be specified using either => or = and can appear anywhere in the argument list.
Hard to find that btw ..
So both seem to be fine.
Glad to hear that either way works, but shouldn’t we aim for consistency? Should we not suggest a standard, even if we don’t enforce it?
GPML, Mark Tompsett
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
Hi, On Mon, Mar 31, 2014 at 7:49 AM, Mark Tompsett <mtompset@hotmail.com> wrote:
Glad to hear that either way works, but shouldn’t we aim for consistency? Should we not suggest a standard, even if we don’t enforce it?
-1 to making it a standard. I have a personal preference for '=>' over '=', but since TT accepts both forms, and I know of no user-visible reasons to prefer one over the other, adding it to the coding guidelines solely for the sake of consistency provides no real benefit. I note that with the possible exception of PERL1, none of the current coding guidelines concern themselves solely with code styling consistency. Regards, Galen -- Galen Charlton Manager of Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
Hie, I was thinking that some automated tools like for QA may need this consistency. But it's no big deal, there is actually no reason. I would also prefer '=>'. Best regards, Le 15/04/2014 20:15, Galen Charlton a écrit :
Hi,
On Mon, Mar 31, 2014 at 7:49 AM, Mark Tompsett <mtompset@hotmail.com> wrote:
Glad to hear that either way works, but shouldn’t we aim for consistency? Should we not suggest a standard, even if we don’t enforce it?
-1 to making it a standard. I have a personal preference for '=>' over '=', but since TT accepts both forms, and I know of no user-visible reasons to prefer one over the other, adding it to the coding guidelines solely for the sake of consistency provides no real benefit.
I note that with the possible exception of PERL1, none of the current coding guidelines concern themselves solely with code styling consistency.
Regards,
Galen
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
participants (4)
-
Fridolin SOMERS -
Galen Charlton -
Marcel de Rooy -
Mark Tompsett