dateStringOrganization static method

String dateStringOrganization(
  1. String dateFromLine
)

Fixing a string date of whatsapp to a parsable dart date

Implementation

static String dateStringOrganization(String dateFromLine) {
  dateFromLine = dateFromLine.replaceAll('[', '');
  List listOfMonthDayYear = dateFromLine.split(RegExp(r"[/|.]"));
  listOfMonthDayYear[0] = fixMonthOrDayTo01(listOfMonthDayYear[0]);
  listOfMonthDayYear[1] = fixMonthOrDayTo01(listOfMonthDayYear[1]);
  listOfMonthDayYear[2] = _fixYear20(listOfMonthDayYear[2]);
  listOfMonthDayYear = _sortList(listOfMonthDayYear);
  String date = _listToStringDate(listOfMonthDayYear);
  return date;
}