Simplify daysArrayFunction in checkDate