[Bug 24643] New: Koha::DateUtils::dt_from_string rfc3339 cannot handle high precision seconds
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Bug ID: 24643 Summary: Koha::DateUtils::dt_from_string rfc3339 cannot handle high precision seconds Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: andrew.isherwood@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org The RFC3339 spec (https://www.ietf.org/rfc/rfc3339.txt) says that the second component of a date/time can contain fractions of a second, e.g. 2011-10-05T14:48:00.000Z This is the format returned by Javascript's toISOString() function. Unfortunately, when dt_from_string encounters a string in this format, it effectively drops the time component entirely and you end up with: 2011-10-05T00:00:00Z The problem lies in the regex that attempts to match the string when dt_from_string is called with the 'rfc3339' parameter. Adding support for optional fractions is straightforward. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #1 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Created attachment 98762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98762&action=edit Bug 24643: Support fractional seconds This patch allows dt_from_string to handle RFC3339 strings containing fractional seconds up to one thousandth of a second. Test plan: - Apply patch - prove t/DateUtils.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #2 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Created attachment 98763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98763&action=edit Add unit tests -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #3 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Created attachment 98764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98764&action=edit Bug 24643: Add unit tests -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98763|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24608 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24608 [Bug 24608] Allow modification of checkout due date -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |andrew.isherwood@ptfs-europ |ity.org |e.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 David Nind <david@davidnind.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=24643 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98762|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 98780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98780&action=edit Bug 24643: Support fractional seconds This patch allows dt_from_string to handle RFC3339 strings containing fractional seconds up to one thousandth of a second. Test plan: - Apply patch - prove t/DateUtils.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98764|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 98781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98781&action=edit Bug 24643: Add unit tests https://bugs.koha-community.org/show_bug.cgi?id=24643 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Depends on| |18330 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 [Bug 18330] REST API: Date-time handling -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24643 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98780|0 |1 is obsolete| | Attachment #98781|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98825&action=edit Bug 24643: Support fractional seconds This patch allows dt_from_string to handle RFC3339 strings containing fractional seconds up to one thousandth of a second. Test plan: - Apply patch - prove t/DateUtils.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98826 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98826&action=edit Bug 24643: Add unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98827 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98827&action=edit Bug 24643: Add test to cover the timezone Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00 |20.05.00, 19.11.04 released in| | Status|Pushed to master |Pushed to stable CC| |joy@bywatersolutions.com --- Comment #10 from Joy Nelson <joy@bywatersolutions.com> --- Pushed to 19.11.x branch for 19.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00, 19.11.04 |20.05.00, 19.11.04, released in| |19.05.09 CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24850 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24850 [Bug 24850] Koha::DateUtils ignored offsets in RFC3339 datetimes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|24608 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24608 [Bug 24608] Allow modification of checkout due date -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org