public interface

DateTimeFieldChangeLogHelper

com.atlassian.jira.issue.history.DateTimeFieldChangeLogHelper
Known Indirect Subclasses

Class Overview

A helper component which can be used by (custom)fields to store date/time information in the issue change history.

Summary

Public Methods
String createChangelogValueForDateField(Date date)
Converts a Date into a string representation for the issue change history.
String createChangelogValueForDateTimeField(Date date)
Converts a Date into a string representation for the issue change history.
String renderChangeHistoryValueDate(String dateValue, String dateStr)
Use this method to render a value for the issue change history that has been stored using the method createChangelogValueForDateField().
String renderChangeHistoryValueDateTime(String dateTimeValue, String dateTimeString)
Use this method to render a value for the issue change history that has been stored using the method createChangelogValueForDateTimeField().

Public Methods

public String createChangelogValueForDateField (Date date)

Converts a Date into a string representation for the issue change history. Call this method, if you want to store a change history value for a (custom)field which stores ONLY calendar date (day, month, year) information.

Parameters
date date the value Date of the (custome)field
Returns
  • a string representation of the date.

public String createChangelogValueForDateTimeField (Date date)

Converts a Date into a string representation for the issue change history. Call this method, if you want to store a change history value for a (custom)field which stores date AND time information.

Parameters
date the value Date of the (custome)field
Returns
  • a string representation of the date, which contains date AND time.

public String renderChangeHistoryValueDate (String dateValue, String dateStr)

Use this method to render a value for the issue change history that has been stored using the method createChangelogValueForDateField(). This value should contain only date information. The com.atlassian.jira.datetime.DateTimeStyle.DATE formatter is used to render the change history value.

Parameters
dateValue the value of the ChangeHistoryItem
dateStr the string of the ChangeHistoryItem, if it can't convert the dateValue it will return the dateStr.
Returns
  • either a formatted date string, if it failed to convert the value it return the dateStr.

public String renderChangeHistoryValueDateTime (String dateTimeValue, String dateTimeString)

Use this method to render a value for the issue change history that has been stored using the method createChangelogValueForDateTimeField(). This value should contain time AND time information. The com.atlassian.jira.datetime.DateTimeStyle.DATE_TIME_PICKER formatter is used to render the change history value.

Parameters
dateTimeValue the value of the ChangeHistoryItem
dateTimeString the string of the ChangeHistoryItem, if it can't convert the dateTimeValue it will return the dateStr.
Returns
  • either a formatted date string, if it failed to convert the value it return the dateTimeString.