AmpTimeago

Inheritance: java.lang.Object, com.aspose.email.AmpComponent

public class AmpTimeago extends AmpComponent

Provides fuzzy timestamps by formatting dates as “X time ago”

Constructors

Constructor Description
AmpTimeago(Date dateTime) Create instance of AmpTimeago.
AmpTimeago(Date dateTime, int width, int height) Create instance of AmpTimeago.

Methods

Method Description
getDateTime() A datetime.
setDateTime(Date value) A datetime.
getLocale() By default, the local is set to en; however, you can specify other locales.
setLocale(String value) By default, the local is set to en; however, you can specify other locales.
getCutoff() Display the original date if time distance is older than cutoff (seconds).
setCutoff(int value) Display the original date if time distance is older than cutoff (seconds).
getRequiredScript() Required script that muct be added to head section.
toAmpHtml() Represents amp html version of component.
toHtml() Represents html version of component.

AmpTimeago(Date dateTime)

public AmpTimeago(Date dateTime)

Create instance of AmpTimeago.

Parameters:

Parameter Type Description
dateTime java.util.Date

AmpTimeago(Date dateTime, int width, int height)

public AmpTimeago(Date dateTime, int width, int height)

Create instance of AmpTimeago.

Parameters:

Parameter Type Description
dateTime java.util.Date
width int
height int

getDateTime()

public final Date getDateTime()

A datetime.

Returns: java.util.Date

setDateTime(Date value)

public final void setDateTime(Date value)

A datetime.

Parameters:

Parameter Type Description
value java.util.Date

getLocale()

public final String getLocale()

By default, the local is set to en; however, you can specify other locales. See full list of supported locales https://amp.dev/documentation/components/amp-timeago/?format=email

Returns: java.lang.String

setLocale(String value)

public final void setLocale(String value)

By default, the local is set to en; however, you can specify other locales. See full list of supported locales https://amp.dev/documentation/components/amp-timeago/?format=email

Parameters:

Parameter Type Description
value java.lang.String

getCutoff()

public final int getCutoff()

Display the original date if time distance is older than cutoff (seconds).

Returns: int

setCutoff(int value)

public final void setCutoff(int value)

Display the original date if time distance is older than cutoff (seconds).

Parameters:

Parameter Type Description
value int

getRequiredScript()

public String getRequiredScript()

Required script that muct be added to head section.

Returns: java.lang.String

toAmpHtml()

public String toAmpHtml()

Represents amp html version of component.

Returns: java.lang.String -

toHtml()

public String toHtml()

Represents html version of component.

Returns: java.lang.String -