Class DateFormat

java.lang.Object
com.tccc.kos.commons.util.format.date.DateFormat
Direct Known Subclasses:
D_ddMMyy, D_MMddyy, D_yyyyMMdd

public class DateFormat extends Object
Describes a date format for both Java and JavaScript. This includes a hint about the order of month/day/year, which allows editors to generate the correct options for the format.

Date formatting characters are:

  y = year-of-era
  M = month-of-year
  d = day-of-month
 
Since:
1.0
Version:
2023-02-24
See Also:
  • Constructor Details

    • DateFormat

      public DateFormat(String id, String format, String order)
      Creates a new date format with the specified properties.
      Parameters:
      id - the ID of the format
      format - format string
      order - three character string using 'm', 'd', and 'y' to indicate the correct ordering
  • Method Details

    • getId

      public String getId()
      Returns the ID of the format, which is used to identify and select the format. This should not be a display value. A localization key should be used to convert this to a display string.
    • getFormat

      public String getFormat()
      Returns the format string for this date format.
    • getOrder

      public String getOrder()
      Returns the order of month/day/year in this format. This provides a hint to tooling, such as editors, so they can match the format.