code: public static DateTimeFormatter getDateFormatter(DateStyle dateStyle, boolean incTime) {
          String format = dateStyle.equals(DateStyle.DAY_FIRST) ? "dd-MM-yyyy" : "MM-dd-yyyy";
          return DateTimeFormatter.ofPattern(incTime ? format + " HH:mm" : format);
      }
docs: Gets a formatter for dates or datetimes
  @param dateStyle whether parsing should be day-first or month-first
  @param incTime whether to include time
  @return the formatter