moved format logic into controller and all day logic; closes #1062