I have a date in string format . i want to check whether the date is correct according to month or not. e.g january shouldnot exceed by 31.
Hence 32/1/2016 shold be invalid date.
def check(date:String,format:String)={
val splittedDate=date.split("/")
val res=(fullDay(2).toInt) <= LocalDate.of(fullDay(0).toInt,fullDay(1).toInt,fullDay(2).toInt).lengthOfMonth()
res
}
It will work fine if we call like check("2015/4/5","yyyy/mm/dd"). but don't work with check("2015/4/5","dd/yyyy/mm").