Cleared up implementation of date generation in controller index