bether code for date validation