Origami Frontend Components & Services

JSDoc: o-date

new ODate(rootElement)

Initialise the o-date component.

parameter type default description
rootElement HTMLElement | String The root element or CSS selector to initialise

Methods

Links

ODate#update

Instance Method

Re-render the formatted date within the time element.

Returns

  • undefined

Links

ODate#destroy

Instance Method

Remove o-date from the time element i.e. remove event listeners and drop references to the element.

Returns

  • undefined

Links

ODate.init(el)

Static Method

Initialise the o-date component.

parameter type default description
el HTMLElement | String The root element or CSS selector to initialise

Returns

  • Array.<ODate> | ODate - - An o-date instance or array of o-date instances.

Links

The function "toDate" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.toDate

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "format" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.format

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "getSecondsBetween" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.getSecondsBetween

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "ftTime" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.ftTime

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "isNearFuture" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.isNearFuture

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "isFarFuture" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.isFarFuture

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "isToday" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.isToday

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "isYesterday" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.isYesterday

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "timeAgo" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.timeAgo

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "asTodayOrYesterdayOrNothing" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.asTodayOrYesterdayOrNothing

Static Method

Returns

  • String - - A formatted date or empty string.

Links

The function "timeAgoNoSeconds" is deprecated. Use [ft-date-format](https://github.com/Financial-Times/ft-date-format) instead.

ODate.timeAgoNoSeconds

Static Method

Returns

  • String - - A formatted date or empty string.

Links

new ODate(rootElement)

Initialise the o-date component.

parameter type default description
rootElement HTMLElement | String The root element or CSS selector to initialise

Methods

Links

Status
active Origami v1
Switch component view

GitHub Repository

Install o-date

If using the Build Service, add o-date@^4.1.2 to your script tag.

If running a Manual Build, run npm install "o-date@^4.1.2".

Help & Support

o-date is maintained directly by the Origami team. If you have any questions about o-date or Origami in general, we are happy to help. 😊

Slack: #origami-support
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #origami-support
Email: origami.support@ft.com