The number of days that the date increases (decreases).
In the process of building YIDA applications, you may encounter the following problems.
- Project managementIn the system,After the start date of the task is set, add the duration of the task to automatically calculate the completion date of the task..
- Contract ManagementIn the system,Enter the invoice date and account period days to calculate the payment deadline..
Prerequisites
This tutorial uses the form formula of YIDA. You can first understand the followingForm formula.
Effect
Implementation steps
Create a common form page
Create a common form page. For more information, seeCommon form.
Drag the following components into the canvas area.
- Date: Named as date
- Date: named formula configuration: date after 10 days
- Date: named formula configuration: date 10 days ago
- Date: named quick configuration: 10 days later
- Date: named quick configuration: 10 days ago
Add Form formula
Select quick configuration for the date component. The default value is today.
Formula configuration: the date after 10 days. The default value is formula editing, and the formula shown in the following figure is configured. You can also copy the formula source code directly, and pay attention to modifying the fields.
{"text":"DATEDELTA(DATE(日期),10)","marks":[{"from":{"line":0,"ch":15,"sticky":null},"to":{"line":0,"ch":19,"sticky":null},"value":"dateField_lc0b1vsg","invalid":false}],"isCmData":true}
Formula configuration: The date 10 days ago. The default value is formula editing, and the formula shown in the following figure is configured. You can also copy the formula source code directly, and pay attention to modifying the fields.
{"text":"DATEDELTA(DATE(日期),-10)","marks":[{"from":{"line":0,"ch":15,"sticky":null},"to":{"line":0,"ch":19,"sticky":null},"value":"dateField_lc0b1vsg","invalid":false}],"isCmData":true}
Quick configuration
Shortcut configuration: the date after 10 days. By default, select shortcut configuration and configure it as shown in the following figure.
Shortcut configuration: The date 10 days ago. The default value is shortcut configuration, and the configuration is as shown in the following figure.