diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index ae8038b05..cc0fb4f72 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1159,10 +1159,21 @@ function test_datepicker() { $(".selector").datepicker({ altField: "#actualDate" }); // getter - var altField = $(".selector").datepicker("option", "altField"); + var altField: any = $(".selector").datepicker("option", "altField"); // setter - $(".selector").datepicker("option", "altField", "#actualDate"); + var $set: JQuery = $(".selector").datepicker("option", "altField", "#actualDate"); + } + + // Options + function altFormat() { + $(".selector").datepicker({ altFormat: "yy-mm-dd" }); + + // getter + var altFormat: string = $(".selector").datepicker("option", "altFormat"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "altFormat", "yy-mm-dd"); } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index a44c24bc4..4bd2e433f 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -952,7 +952,7 @@ interface JQuery { * @param optionName 'altField' * @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. */ - datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): any; + datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): JQuery; /** * Set the altField option, after initialization * @@ -960,7 +960,7 @@ interface JQuery { * @param optionName 'altField' * @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. */ - datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): any; + datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): JQuery; /** * Set the altField option, after initialization * @@ -968,7 +968,23 @@ interface JQuery { * @param optionName 'altField' * @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. */ - datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): any; + datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): JQuery; + + /** + * Get the altFormat option, after initialization + * + * @param methodName 'option' + * @param optionName 'altFormat' + */ + datepicker(methodName: 'option', optionName: 'altFormat'): string; + /** + * Set the altFormat option, after initialization + * + * @param methodName 'option' + * @param optionName 'altFormat' + * @param altFormatValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. + */ + datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery; /** * Gets the value currently associated with the specified optionName.