[Koha-bugs] [Bug 13601] Get rid of DateTime::Format::DateParse

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 9 09:40:02 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13601

Jonathan Druart <jonathan.druart at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35406|0                           |1
        is obsolete|                            |

--- Comment #12 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Created attachment 36734
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36734&action=edit
Bug 13601: Make dt_from_string not using DateTime::Format::DateParse

For a couple of reasons, dt_from_string should not use
DateTime::Format::DateParse:
1/ It does not manage date < 1900, certainly caused by l.47 of this
module:
 $p{ year }      = $year ? $year + 1900 : DateTime->now->year;

2/ It considers 31/01/2015 as a valid us date, which is not.

Test plan:
1/ Verify that
  prove t/DateUtils.t
returns green
2/ Play with dates in Koha (yes I know, it's vague...)
3/ Try to find a regression with dates
4/ Create a date with year <= 1900 and confirm it works

QA comment:
Why the sql format switch was:
-                $date_string =~
-s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/;

>From where a date like "yyyymmdd hhmmss" can come?

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


More information about the Koha-bugs mailing list