Issue
I got stuck while converting Array of String to Array of Date
{
String[] departureDate=request.getParameterValues("departureDate");
}
How do I convert the above Strings to Date[] ?
Solution
Solved the problem.
String[] departureDate=request.getParameterValues("departureDate");
List<Date> date=(List<Date>) new Date();
for(String dateToConvert : departureDate) {
try {
Date convertedDate= formatter.parse(dateToConvert);
date.add(convertedDate);
}
catch (ParseException e) {
e.printStackTrace();
}
}
Answered By - Munal Dhakal