moved date conversions into controller