[Koha-bugs] [Bug 12072] New dateformat dd.mm.yyyy
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Apr 16 13:25:00 CEST 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12072
--- Comment #18 from paxed <pasi.kallinen at pttk.fi> ---
(In reply to Jonathan Druart from comment #16)
> Comment on attachment 27130 [details] [review]
> [SIGNED-OFF] Bug 12072: Add date format dd.mm.yyyy.
>
> Review of attachment 27130 [details] [review]:
> -----------------------------------------------------------------
>
> ::: C4/Dates.pm
> @@ +40,4 @@
> >
> > sub _prefformat {
> > unless ( defined $prefformat ) {
> > + $prefformat = C4::Context->preference('dateformat') || 'us';
>
> I disagree with setting a default value for this pref. It must exist in DB.
How can it exist before Koha is installed? The installer uses templates, and
as dateformatstyle is passed on to templates... I guess part 2 below solves
that problem then.
>
> ::: C4/Templates.pm
> @@ +112,4 @@
> > $vars->{opacsmallimage} = C4::Context->preference('opacsmallimage');
> > $vars->{opaclayoutstylesheet} =
> > C4::Context->preference('opaclayoutstylesheet');
> > + $vars->{dateformatstyle} = C4::Dates->new()->formatstr();
>
> 1/ Prefer to use Koha::DateUtils instead of C4::Dates.
> 2/ C4::Dates is not used in C4::Templates.
> 3/ Prefer to sent variable to template in C4::Auth (common way to do).
> 4/ Very good initiative!
1/ Because Koha::DateUtils doesn't do what is needed here - it knows nothing
about the actual formatting string, just a user-friendly format name like
"metric".
2/ True, that needs to be added.
3/ Didn't know about that.
4/ Just bare necessity.
>
> ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
> @@ +283,4 @@
> > return;
> > }
> > var date_due = new Date($('#duedatespec').datepicker('getDate'));
> > + date_due.setHours(23, 59);
>
> Hum... why this change?
Because offline UI showed the date AND the time in the datetimepicker... but
the time was always hardcoded to 23:59. The other change in the offline UI was
to remove the time display from the datepicker.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list