Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Date Control API > Methods

JavaScript API: Date Control API > getMomentValue()

Scroll Prev Next More

 

This method gets the Date control value as a Moment.js object.

Syntax

ctrl.getMomentValue()

Arguments

No arguments.

Return value

The date control value as a Moment.js object.

Example

getMomentValue() can be used in the JavaScript OnLoad event, as well as any other JavaScript event.

 

Show the date, entered into the selected control:

 

var ctrl = Runner.getControl(pageid, 'datefield');
var moment_date = ctrl.getMomentValue();
alert(moment_date);

 

Note: replace "datefield" with the actual field name in the function.

See also:

JavaScript API: Control object > getControl()

JavaScript API: Date Control API > setValue()

JavaScript API: Date Control API > getValue()

Date control API

JavaScript API