Add date detection in controllers