fixes bug when selecedDate is gregorian