From a837642b084667e14eb483501e67ee7ea6b2656d Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Mon, 30 Dec 2024 15:17:24 +0000 Subject: [PATCH] updated survey-library docs [azurepipelines skip] --- docs/design-survey-conditional-logic.md | 19 +++---------------- ...esign-survey-create-a-multi-page-survey.md | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/docs/design-survey-conditional-logic.md b/docs/design-survey-conditional-logic.md index 046d8220b5..82a3250cc7 100644 --- a/docs/design-survey-conditional-logic.md +++ b/docs/design-survey-conditional-logic.md @@ -313,7 +313,8 @@ The following built-in functions are available: - [`day`](#day) - [`weekday`](#weekday) - [`getDate`](#getdate) -- [`diffDays`](#diffdays) +- [`dateAdd`](#dateadd) +- [`dateDiff`](#datediff) - [`sum`](#sum) - [`max`](#max) - [`min`](#min) @@ -469,7 +470,7 @@ Returns a Date value converted from a given question's value. *Definition*: `dateAdd(date: any, numberToAdd: number, interval: "days" | "months" | "years"): Date` -Adds a specified number of full days (default), months, or years to a date value. +Adds or subtracts a specified number of full days (default), months, or years to or from a date value. *Example*: `"expression": "dateAdd({startDate}, 14, "days")"` @@ -489,20 +490,6 @@ Returns a difference between two given dates in full days (default), months, or --- -#### `diffDays` - -> This function is obsolete. Use the [`dateDiff`](#datediff) function instead. - -*Definition*: `diffDays(fromDate: any, toDate: any): number` - -Returns the number of days between two given dates. - -*Example*: `"expression": "diffDays({startDate}, {endDate}) < 7"` - -[View Source Code](https://github.com/surveyjs/survey-library/blob/68eb0054dc83d2f45a6daa1042bf7440c8faf007/src/functionsfactory.ts#L266-L274 (linkStyle)) - ---- - #### `sum` *Definition*: `sum(param1: number, param2: number, ...): number` diff --git a/docs/design-survey-create-a-multi-page-survey.md b/docs/design-survey-create-a-multi-page-survey.md index 6a024d2032..eeb24fe9d9 100644 --- a/docs/design-survey-create-a-multi-page-survey.md +++ b/docs/design-survey-create-a-multi-page-survey.md @@ -215,7 +215,7 @@ Navigates the respondent to the next page. Returns `false` if the navigation did - [`prevPage()`](https://surveyjs.io/Documentation/Library?id=surveymodel#prevPage) Navigates the respondent to the previous page. Returns `false` if the navigation did not happen, for instance, because the current page is the first page. Unlike with `nextPage()`, validation errors are ignored. -- [`completeLastPage()`](https://surveyjs.io/Documentation/Library?id=surveymodel#completeLastPage) +- [`tryComplete()`](https://surveyjs.io/Documentation/Library?id=surveymodel#tryComplete) Completes the survey. Fails and returns `false` if the current page has validation errors. - [`doComplete()`](https://surveyjs.io/Documentation/Library?id=surveymodel#doComplete)