Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleFieldFormatters Interface
public interface FieldFormatters {
 
//JIRA Date Formatting Options
  /**
  * @returns An object of https://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/datetime/DateTimeFormatter.html
  */
  DateTimeFormatter getJiraDateTimeFormatter();
 
  /**
  * @returns An object of https://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/datetime/DateTimeFormatter.html
  */
  DateTimeFormatter getJiraDateTimeFormatter(String styleName);
 
  /**
	Formats a Date object using the given formatter.
    @returns formatted date string or empty string if format is not valid, never returns null
  */
  String formatSafely(DateTimeFormatter dateFormat, Date value);
 
  /**
	Formats a object using the given formatter. If the value object is not a Date, it returns empty string.

    @returns formatted date string or empty string if format is not valid, never returns null
  */
  String formatSafely(DateTimeFormatter dateFormat, Object value);
 
//Java Date Formatting Options
  DateFormat getJavaDateFormat();
  DateFormat getJavaDateFormat(int style);
  DateFormat getJavaDateFormat(int style, String locale);
  DateFormat getJavaDateTimeFormat();
  DateFormat getJavaDateTimeFormat(int dateStyle, int timeStyle);
  DateFormat getJavaDateTimeFormat(int dateStyle, int timeStyle, String locale);  
  DateFormat getJavaDateTimeFormat(String pattern);
 
  /**
	Formats a object using the given DateFormat. If the value object is not a Date, it returns empty string.

    @returns formatted date string or empty string if format is not valid, never returns null
  */
  String formatSafely(DateFormat dateFormat, Object value);
 
 /**
	Formats a object using the given DateFormat. If the value object is not a Date, it returns empty string.

    @returns formatted date string or empty string if format is not valid, never returns null
  */
  String formatSafely(DateFormat dateFormat, Date value);

}

...