public interface

DateFormatter

com.atlassian.bitbucket.util.DateFormatter

Class Overview

Allows the formatting of a date according to predefined formats.

Summary

Nested Classes
enum DateFormatter.FormatType A predefined date format. 
Constants
String PROPERTY_KEY_PREFIX
Public Methods
@Nonnull String formatDate(Date date, DateFormatter.FormatType type)
Format the passed date.
@Nonnull String formatInstant(Instant instant, DateFormatter.FormatType type)
Format the passed Instant.
@Nullable String getFormatString(String key)

Constants

public static final String PROPERTY_KEY_PREFIX

Constant Value: "bitbucket.date.format"

Public Methods

@Nonnull public String formatDate (Date date, DateFormatter.FormatType type)

Format the passed date.

Parameters
date the date to format.
type the type of date rendering to generate.
Returns
  • the formatted date.

@Nonnull public String formatInstant (Instant instant, DateFormatter.FormatType type)

Format the passed Instant.

Parameters
instant the instant to render.
type the type of date rendering to generate.
Returns
  • the formatted instant.
Throws
NullPointerException if any of the arguments is null.

@Nullable public String getFormatString (String key)