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 ) ; }
Gets a formatter for dates or datetimes