[Koha-bugs] [Bug 30059] Add a JS equivalent to Koha::Patron->get_age

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 22 13:52:33 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30059

--- Comment #7 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Martin Renvoize from comment #4)
> Might be an unpopular view.. but don't we already pull in moment.js for
> other date manipulations.. so couldn't we use
> https://momentjs.com/docs/#/displaying/difference/ to get a rather accurate
> result?

I'd agree with this. I also wonder... if the browser date should be used, or
the server's... I guess it is not that important. But if we think the UI could
make a decision, based on the age, and place a request, this could be rejected
because the server could have its own age check, leading to inconsistent
behavior.

In that case, I'd just allow embedding the age like in:

GET /patrons
x-koha-emebed: age

(it would require renaming the ->get_age method)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list