toDate function
convert the input to a date, or null if the input is not a date
Implementation
DateTime toDate(String str) {
try {
return DateTime.parse(str);
} catch (e) {
return null;
}
}
convert the input to a date, or null if the input is not a date
DateTime toDate(String str) {
try {
return DateTime.parse(str);
} catch (e) {
return null;
}
}