fix bugs. showOnlyValidDates option is added