calculate day dates in factory