DatesRole: refactoring into utility function