cjsolomon / Mulit-Modal

SRU Multi-Modal Project
0 stars 2 forks source link

isValidDate #24

Closed cjsolomon closed 10 years ago

cjsolomon commented 10 years ago

isValidDate does not work when loading from the database

zgp1001 commented 10 years ago

This issue is because I think we have 0 for some dates. I do a check on the 2nd character to see which format is used. I'll add in a test that rejects anything that is shorter than expected. Thanks for bringing this to my attention.

ghost commented 10 years ago

JUnit is currently saying this

The following date is returning as valid 123 h 1983
zgp1001 commented 10 years ago

The code was commented out by Chris due to the error (always set to true). I just put in a possible fix for his issue, pushing now.

zgp1001 commented 10 years ago

Pushed.

One potential problem is that it will reject a few values from the database where the date is set = to 0. I can run a script to update any 0'd values in the database to our default date to fix this if desired. We should also make sure the database default value is a valid date and not 0.