Class DateFormatServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.datetime.DateFormatServiceImpl
-
- All Implemented Interfaces:
DateFormatService
public class DateFormatServiceImpl extends Object implements DateFormatService
-
-
Constructor Summary
Constructors Constructor Description DateFormatServiceImpl(UserPreferencesAccessor userPreferencesAccessor, FormatSettingsManager formatSettingsManager, LocaleManager localeManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDateFormatPatternForUser()
String
getFormattedDateByUserLocale(LocalDate date)
Format the given date in an appropriate format according to the user's locale.String
getFormattedDateByUserLocale(org.joda.time.LocalDateTime date)
Format the given date in an appropriate format according to the user's locale.
-
-
-
Constructor Detail
-
DateFormatServiceImpl
public DateFormatServiceImpl(UserPreferencesAccessor userPreferencesAccessor, FormatSettingsManager formatSettingsManager, LocaleManager localeManager)
-
-
Method Detail
-
getFormattedDateByUserLocale
public String getFormattedDateByUserLocale(org.joda.time.LocalDateTime date)
Description copied from interface:DateFormatService
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.- Specified by:
getFormattedDateByUserLocale
in interfaceDateFormatService
- Parameters:
date
- the date to format- Returns:
- the date formatted accordingly in the current user's locale
-
getFormattedDateByUserLocale
public String getFormattedDateByUserLocale(LocalDate date)
Description copied from interface:DateFormatService
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.- Specified by:
getFormattedDateByUserLocale
in interfaceDateFormatService
- Parameters:
date
- the date to format- Returns:
- the date formatted accordingly in the current user's locale
-
getDateFormatPatternForUser
public String getDateFormatPatternForUser()
- Specified by:
getDateFormatPatternForUser
in interfaceDateFormatService
- Returns:
- the date format pattern in a string according to the user's locale
-
-