rbf_formatDate()

Warning: Support for using this method with external objects (such as those mapped to external tables, to OpenEdge Service objects, or through a HDP connection) is a beta feature. This method is supported in production systems, except for external objects.

Purpose

This function formats a JavaScript Date object into a string suitable for storing in Date input fields.

Note: When using the New UI, Infinite Blue recommends obtaining the date format from the user's localization settings via the PageLocalization object. See the example below. See PageLocalization for more information about the PageLocalization object. In addition, all date formats used in the New UI should conform to those in the Kendo formatting library. See the Kendo UI documentation for more information.

Syntax

rbf_formatDate(d, format)

Parameters

d

A JavaScript Date object

format

The format to apply to the date, such as dd/mm/yyyy, mm.dd.yy, etc.

Note: This API is supported in portals as well.

Example

This example uses the PageLocalization object to populate the format parameter:

rbf_formatDate(new Date(), rbf_getPageContext().getPageLocalization().getDateFormat());