GetDate
Retrieves the selected date value from a date picker content control and returns it as a Date object.
Throws: Error if the content control is not a date picker.
Syntax
expression.GetDate();
expression - A variable that represents a ApiInlineLvlSdt class.
Parameters
This method doesn't have any parameters.
Returns
undefined | Date
Example
Retrieve the date from a datepicker content control in a document.
// How can I get the date using an inline content control in a document?
// Get the date for an inline content control in a document.
let doc = Api.GetDocument();
let contentControl = doc.AddDatePickerContentControl();
contentControl.SetDateFormat("yyyy-mm-dd");
contentControl.SetDate(new Date(1961, 9, 3));
let paragraph = Api.CreateParagraph();
doc.Push(paragraph);
let date = contentControl.GetDate();
paragraph.AddText(date.toDateString());