Interface DateFormatService

All Known Implementing Classes:
DateFormatServiceImpl

public interface DateFormatService
A service to help format dates
Since:
5.5
  • Method Details

    • getFormattedDateByUserLocale

      String getFormattedDateByUserLocale(LocalDate date)
      Format the given date in an appropriate format according to the user's locale. This can be used to display date to the user. Note that this does not perform timezone conversion.
      Parameters:
      date - the date to format
      Returns:
      the date formatted accordingly in the current user's locale
      Since:
      8.6
    • getDateFormatPatternForUser

      String getDateFormatPatternForUser()
      Returns:
      the date format pattern in a string according to the user's locale
    • getFormattedRelativeTime

      String getFormattedRelativeTime(Instant instant)
      Formats a date in a relative, friendly way. For example, "2 minutes ago".
      Since:
      8.8