code: static public LocalDate getParsedDateOrNull(String text,
          DateTimeFormatter displayFormatterADStrict, DateTimeFormatter displayFormatterBCStrict, 
          ArrayList<DateTimeFormatter> parsingFormattersStrict,
          Locale formatLocale) {
          if (text == null || text.trim().isEmpty()) {
              return null;
          }
          text = text.trim().toLowerCase();
          LocalDate parsedDate = null;
          if (parsedDate == null) {
              try {
                  parsedDate = LocalDate.parse(text, displayFormatterADStrict);
              } catch (Exception ex) {
              }
          }
          if (parsedDate == null) {
              try {
                  // Note: each parse attempt must have its own try/catch block.
                  parsedDate = LocalDate.parse(text, displayFormatterBCStrict);
              } catch (Exception ex) {
              }
          }
          for (int i = 0; ((parsedDate == null) && (i < parsingFormattersStrict.size())); ++i) {
              try {
                  parsedDate = LocalDate.parse(text, parsingFormattersStrict.get(i));
              } catch (Exception ex) {
              }
          }
          return parsedDate;
      }
docs: getParsedDateOrNull, This takes text from the date picker text field, and tries to parse it
  into a java.time.LocalDate instance. If the text cannot be parsed, this will return null.
  
  Implementation note: The DateTimeFormatter parsing class was accepting invalid dates like
  February 31st, and returning the last valid date of the month, like Feb 28. This could be
  seen as an attempt to be lenient, but in the context of the date picker class it is
  considered a mistake or a bug. There was no setting to disable that functionality. So, this
  function calls another function called doesParsedDateMatchText(), to analyze and reject those
  kinds of mistakes. If the parsed text does not match the day of the month (and year) of the
  parsed date, then this function will return null.
  
  Technical note: Nonexistent dates like "Feb 31", are now handled by exclusively passing in
  parsing formats that are set to ResolverStyle.STRICT.