Hi Anthony,
In the case you're describing, the system is actually supposed to consider those two values equal as per the comparison method you've suggested. I'll look into why it might not be doing so, and hopefully we can make a fix available soon. Thank you for bringing this to our attention!
Regards,
Tim
I should have made it clear to say "lowest common non-missing date/time element". For example,
When --STDTC = '2009-11-19T01:02' and --ENDTC = '2009-11--T00:00'
Then compare using '2009-11' and '2009-11'; string comparison typically based on ASCII order will return --STDTC ≥ --ENDTC because 1 is ASCII 49, while 45 for dash
Similarly, when --STDTC = '2009-11-19T01:02' and --ENDTC = '2009-11--T00:00'
Then compare using '2009-11' and '2009-11'
Also, date/time comparison should only occur when both values are ISO 8601-compliant to avoid double reporting.
Hi Anthony,
Just as a follow-up, we will be adding in more adequate date comparison logic based on your suggestion in the next version of the Validator. I did want to clarify what to do about cases where the leading elements are missing though. Given the dates '--05-04' (with missing year) and '2009-05-04', what would the expected comparison behaviour be? Would they be considered equal, given '05-04' is the first comparable portion?
I'll make sure that the configuration developers are aware of the problems with non-compliant date/time comparisons too, as that's probably something that can consider taking care of at the rule definition level.
Regards,
Tim
Good question (and good to see you active here).
--STDTC = '--05-04'
--ENDTC = '2011-04-08'
In this case, from left to right, we don't have a lowest common non-missing date element. My suggestion is to output a message citing it is not comparable.
--STDTC = '--05-04'
--ENDTC = '--05-01'
Likewise, this is not comparable because it is inconclusive without a year.
This leads me to think what if:
--STDTC = '------T02:00:00'
--ENDTC = '------T01:00:00'
Date elements missing being problematic aside, I lean toward not comparable.
This seems like a good approach to me as well, so I'll go ahead and make the updates for the next release. Thanks for the feedback!
Regards,
Tim
For checks related to comparing 2 dates, e.g., --STDTC ≥ --ENDTC, suggest to take partial into account. Currently, a --STDTC = '2009' and --ENDTC = '2009-11-19' trigger SD0013 "Begin day must be less than or equal to end day". Since month and day are unknown in --STDTC, this finding is arguably a false positive. My suggestion is to use the lowest common date/time component. Therefore, in the example above, compare "2009" to "2009".
Operating environment:
v1.2 USB version, Windows XP Professional SP3, off-the-shelf configurations