This function is used inside the verifyDateEntry function, whic is used to verify if a date is correct. The function setCorrectDate verifies if the year, month, day, hour, minutes or seconds are correct. For example, the day has to be an integer between 1 and 31, the minutes and seconds must be integers between 0 an 59 etc.
setCorrectDate(x, type)
The element to test
The type of element: year, month, day, hour, minute or second
The element if it is valid; NA otherwise.