edits.seer.internal.contexts.compareDate.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validation-edits-seer Show documentation
Show all versions of validation-edits-seer Show documentation
Java implemenation of the SEER edits.
The newest version!
<entry id="compareDate" type="groovy"><![CDATA[// this closure is used to compare two dates return { Integer year1, Integer month1, Integer day1, Integer year2, Integer month2, Integer day2 -> int y1 = year1 == null ? 9999 : year1 int m1 = month1 == null ? 99 : month1 int d1 = day1 == null ? 99 : day1 int y2 = year2 == null ? 9999 : year2 int m2 = month2 == null ? 99 : month2 int d2 = day2 == null ? 99 : day2 if (y1 == 9999 || y2 == 9999) return 0 if (y1 != y2) return y1 - y2 if (m1 == 99 || m2 == 99) return 0 if (m1 != m2) return m1 - m2 if (d1 == 99 || d2 == 99) return 0 return d1 - d2 }]]></entry>