MBS-7558: Relationship-editor shows "The end date cannot preceed the begin date" incorrectly
mwiencek
Branch: mwiencek/musicbrainz-server:mbs-7558
mwiencek/musicbrainz-server:mbs-7558
Branch: metabrainz/musicbrainz-server:beta
metabrainz/musicbrainz-server:beta
Merged
#980 · Created  · Last updated
Description
The problem here was that it was comparing the numbers as strings (so "3" > "10"). So now it converts them to numbers before comparing them. I moved the logic into a validDatePeriod function and added tests for it. I also wrote tests for validDate, and incidentally found an unrelated bug (it would say that ????-??-32 was a valid date).
The problem here was that it was comparing the numbers as strings (so "3" > "10"). So now it converts them to numbers before comparing them. I moved the logic into a validDatePeriod function and added tests for it. I also wrote tests for validDate, and incidentally found an unrelated bug (it would say that ????-??-32 was a valid date).