I have updated the function to keep the original sort check. It now also looks at the precision if it is a date. 2004-10 vs 2004-10-31 will compare the year and month as the first is missing the day digit. Because the two dates overlap, we mark the less precise as false for sort order as we cannot draw conclusions about what day it is. If there is no overlap, we compare based on the lowest precision to determine if they are sorted properly.
I have updated the function to keep the original sort check. It now also looks at the precision if it is a date. 2004-10 vs 2004-10-31 will compare the year and month as the first is missing the day digit. Because the two dates overlap, we mark the less precise as false for sort order as we cannot draw conclusions about what day it is. If there is no overlap, we compare based on the lowest precision to determine if they are sorted properly.