]> git.koha-community.org Git - koha.git/commit
Bug 28585: Use the datetime_parser for handling API dates
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 25 Jun 2021 14:37:29 +0000 (11:37 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 25 Oct 2021 11:56:37 +0000 (13:56 +0200)
commit19b781986c89359f2666a4c8e618fa6465f50f60
treec9534d0251cfc2258486cf5b6d81ce6082c9fc1e
parent90ccfb8f340197029faca349ea175b3870c92137
Bug 28585: Use the datetime_parser for handling API dates

This patchset takes the GET /patrons route as a sample usage for filtering
on date and date-time (including timestamp) fields.

It then makes Koha::Object->attributes_from_api use the DB storage
datetime parser for format the parameters correctly.

To test:

1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: It doesn't find the patron when filtering by date
3. Apply this patch
4. Repeat 2
=> SUCCESS: It works now!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Object.pm