getItemValueDate (NotesXspDocument - JavaScript)

Gets the value of an item as a date.

Syntax

getItemValueDate(name:string) : Date (Date - JavaScript)
Parameter Description
name The name of the item.
Return value Description
Date The item value.

Usage

If multiple items have the same name, this method returns the value of the first item.

If the item has multiple values, this method returns the first value.

If the item does not exist, this method returns null.

If the item is text or a number, this method returns null.

Examples

This computed field that returns the value of the datetime item in the document associated with the current XPage.
var d = document1.getItemValueDate("datetime");
if(d == null) {
	return "datetime is empty or doesn't exist."
} else {
	return d.toLocaleString();
}