[Bug 32559] New: Support formatted date for column filtering (DT)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Bug ID: 32559 Summary: Support formatted date for column filtering (DT) Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Staff interface Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com When dates are displayed formatted (following the dateformat syspref) in a DataTable table and that there is a filter for the column, we should filter correctly the data. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32505 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 [Bug 32505] Cannot search by dateofbirth in specified dateformat -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, maybe data-search could work? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30310 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30310 [Bug 30310] Replace Moment.js with Day.js -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 144951 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144951&action=edit Bug 32559: Add support for formatted date when filtering on a column When dates are displayed formatted (following the dateformat syspref) in a DataTable table and that there is a filter for the column, we should filter correctly the data. Test plan: Assuming dateformat is set to metric Go to the main patron search, search for all patrons (don't provide a search term) In the "date of birth" column filter, enter "1958", notice that you see Henry Search using an iso formatted date 1958-05-30 Search using a metric formatted date 30/05/1958 Note that: - it's also working for "Expires on" on the same table. We may want to adjust other tables that are using the DT REST API wrapper and the column filters - You need to search for the full formatted date to make it work. "30/05" won't work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Katrin Fischer from comment #1)
Hm, maybe data-search could work?
Nope, we need to deal with it "manually", we cannot rely on DT internals. Here we are using the REST API and don't have the data loaded in the DOM already. However I would be happy if someone else come with a better solution. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144951|0 |1 is obsolete| | --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 144954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144954&action=edit Bug 32559: Add support for formatted date when filtering on a column When dates are displayed formatted (following the dateformat syspref) in a DataTable table and that there is a filter for the column, we should filter correctly the data. Test plan: Assuming dateformat is set to metric Go to the main patron search, search for all patrons (don't provide a search term) In the "date of birth" column filter, enter "1958", notice that you see Henry Search using an iso formatted date 1958-05-30 Search using a metric formatted date 30/05/1958 Note that: - it's also working for "Expires on" on the same table. We may want to adjust other tables that are using the DT REST API wrapper and the column filters - You need to search for the full formatted date to make it work. "30/05" won't work. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This looks like a reasonable approach.. I did similar in another bug somewhere a while ago, but this implimentation is a little cleaner. Can we get some unit tests for it? There are tests for the dt wrapper right.. I can't entirely remember. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |ASSIGNED --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #5)
This looks like a reasonable approach.. I did similar in another bug somewhere a while ago, but this implimentation is a little cleaner.
Can we get some unit tests for it? There are tests for the dt wrapper right.. I can't entirely remember.
Yes, t/db_dependent/selenium/patrons_search.t Good idea, I will provide them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 144977 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144977&action=edit Bug 32559: Add tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Excellent, thanks Jonathan. Now we just need the blockers to get unblocked.. I'm chasing Marcel on that as I think he's the most recent touch on them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- The other bug I was talking about was 'Bug 29302 - The dataTables Koha RESTful API wrapper should allow picking match type at the column level'.. where I was trying to do this closer to the datatables JS instantiation rather than in the table header markup. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Ideally we could have use 'type' (https://datatables.net/reference/option/columns.type) with type=date. What I've tried first. But it got removed by DT because it's not useful when server-side processing is used: """Please note that if you are using server-side processing (serverSide) this option has no effect since the ordering and search actions are performed by a server-side script.)""" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144954|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145094 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145094&action=edit Bug 32559: Add support for formatted date when filtering on a column When dates are displayed formatted (following the dateformat syspref) in a DataTable table and that there is a filter for the column, we should filter correctly the data. Test plan: Assuming dateformat is set to metric Go to the main patron search, search for all patrons (don't provide a search term) In the "date of birth" column filter, enter "1958", notice that you see Henry Search using an iso formatted date 1958-05-30 Search using a metric formatted date 30/05/1958 Note that: - it's also working for "Expires on" on the same table. We may want to adjust other tables that are using the DT REST API wrapper and the column filters - You need to search for the full formatted date to make it work. "30/05" won't work. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144977|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145095 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145095&action=edit Bug 32559: Add tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #10)
Ideally we could have use 'type' (https://datatables.net/reference/option/columns.type) with type=date. What I've tried first. But it got removed by DT because it's not useful when server-side processing is used: """Please note that if you are using server-side processing (serverSide) this option has no effect since the ordering and search actions are performed by a server-side script.)"""
Interesting.. I tried with 'type' instead of 'datatype' and it didn't get dropped for me.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 145136 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145136&action=edit Bug 32559: [ALT] Use column 'type' to pre-process search patterns This patch adds the option to pass 'type' at the 'column' definition level and then binds on that type to add date parsing to queries. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Temporarily in discussion whilst I catch Jonathan... I'm still of the opinion his patchset is a bit more functional than mine.. but I am interested to see why the 'type' term didn't work for him when it worked in my patch? Assuming I'm mis-understanding something somewhere. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Bug 32559 depends on bug 32505, which changed state. Bug 32505 Summary: Cannot search by dateofbirth in specified dateformat https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Bug 32559 depends on bug 32505, which changed state. Bug 32505 Summary: Cannot search by dateofbirth in specified dateformat https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Bug 32559 depends on bug 32505, which changed state. Bug 32505 Summary: Cannot search by dateofbirth in specified dateformat https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34226 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |RESOLVED Resolution|--- |DUPLICATE --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- *** This bug has been marked as a duplicate of bug 34226 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Marking as a duplicate and I'm going to lift the tests out of here to re-use with the other patchset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145094|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 153845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153845&action=edit Bug 32559: Add support for formatted date when filtering on a column When dates are displayed formatted (following the dateformat syspref) in a DataTable table and that there is a filter for the column, we should filter correctly the data. Test plan: Assuming dateformat is set to metric Go to the main patron search, search for all patrons (don't provide a search term) In the "date of birth" column filter, enter "1958", notice that you see Henry Search using an iso formatted date 1958-05-30 Search using a metric formatted date 30/05/1958 Note that: - it's also working for "Expires on" on the same table. We may want to adjust other tables that are using the DT REST API wrapper and the column filters - You need to search for the full formatted date to make it work. "30/05" won't work. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145095|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 153846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153846&action=edit Bug 32559: Add tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32559 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145136|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 153847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153847&action=edit Bug 32559: [ALT] Use column 'type' to pre-process search patterns This patch adds the option to pass 'type' at the 'column' definition level and then binds on that type to add date parsing to queries. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org