From b03204e6f034d0962cd9a459642f17b8f02fd5d8 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 23 Apr 2014 09:50:10 +0100 Subject: [PATCH] jQuery UI: changeMonth and changeYear JSDoc --- jqueryui/jqueryui-tests.ts | 18 ++++++++++++++++++ jqueryui/jqueryui.d.ts | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index c922ec161..e2aac42a0 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1270,6 +1270,24 @@ function test_datepicker() { // setter var $set: JQuery = $(".selector").datepicker("option", "calculateWeek", myWeekCalc); } + + function changeMonth() { + $(".selector").datepicker({ changeMonth: true }); + + var changeMonth: boolean = $(".selector").datepicker("option", "changeMonth"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "changeMonth", true); + } + + function changeYear() { + $(".selector").datepicker({ changeYear: true }); + + var changeYear: boolean = $(".selector").datepicker("option", "changeYear"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "changeYear", true); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 083df7b46..2ccd2c262 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1287,10 +1287,41 @@ interface JQuery { * @param methodName 'option' * @param optionName 'buttonText' * @param calculateWeekValue A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year. - */ datepicker(methodName: 'option', optionName: 'calculateWeek', calculateWeekValue: (date: Date) => string): JQuery; + /** + * Get the changeMonth option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'changeMonth'): boolean; + /** + * Set the changeMonth option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param changeMonthValue Whether the month should be rendered as a dropdown instead of text. + */ + datepicker(methodName: 'option', optionName: 'changeMonth', changeMonthValue: boolean): JQuery; + + /** + * Get the changeYear option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'changeYear'): boolean; + /** + * Set the changeYear option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param changeYearValue Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection. + */ + datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery; + /** * Gets the value currently associated with the specified optionName. *