public.javadoc.org.spincast.plugins.dateformatter.RelativeDateFormatterDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
RelativeDateFormatterDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.dateformatter
Class RelativeDateFormatterDefault
- java.lang.Object
-
- org.spincast.plugins.dateformatter.RelativeDateFormatterDefault
-
- All Implemented Interfaces:
- RelativeDateFormatter
public class RelativeDateFormatterDefault
extends Object
implements RelativeDateFormatter
-
-
Constructor Summary
Constructors
Constructor and Description
RelativeDateFormatterDefault(Date date,
LocaleResolver localeResolver)
RelativeDateFormatterDefault(Instant instant,
LocaleResolver localeResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
String
format()
Format!
RelativeDateFormatter
formatType(RelativeDateFormatType formatType)
The type of the format to use.
protected String
getAFewSecondsLabel()
protected Date
getDate()
protected LocaleResolver
getLocaleResolver()
protected org.ocpsoft.prettytime.PrettyTime
getPrettyTime(Locale locale)
protected Map<Locale,org.ocpsoft.prettytime.PrettyTime>
getPrettyTimesByLocale()
RelativeDateFormatter
locale(Locale locale)
The locale to use.
-
-
Constructor Detail
-
RelativeDateFormatterDefault
public RelativeDateFormatterDefault(Instant instant,
LocaleResolver localeResolver)
-
RelativeDateFormatterDefault
public RelativeDateFormatterDefault(Date date,
LocaleResolver localeResolver)
-
Method Detail
-
getDate
protected Date getDate()
-
getLocaleResolver
protected LocaleResolver getLocaleResolver()
-
getPrettyTimesByLocale
protected Map<Locale,org.ocpsoft.prettytime.PrettyTime> getPrettyTimesByLocale()
-
getPrettyTime
protected org.ocpsoft.prettytime.PrettyTime getPrettyTime(Locale locale)
-
locale
public RelativeDateFormatter locale(Locale locale)
Description copied from interface: RelativeDateFormatter
The locale to use.
Defaults to the one provided by the
LocaleResolver
.
- Specified by:
locale
in interface RelativeDateFormatter
-
formatType
public RelativeDateFormatter formatType(RelativeDateFormatType formatType)
Description copied from interface: RelativeDateFormatter
The type of the format to use.
Defaults to RelativeDateFormatType.DEFAULT
.
- Specified by:
formatType
in interface RelativeDateFormatter
-
format
public String format()
Description copied from interface: RelativeDateFormatter
Format!
- Specified by:
format
in interface RelativeDateFormatter
-
getAFewSecondsLabel
protected String getAFewSecondsLabel()
Copyright © 2019. All rights reserved.