fixed date comparisons to use entity functions