1# Time-specific Widget Updates 2 3Form Kit provides the following methods for updating widgets at specific times: 4 5- Setting a single update time: The widget content will be automatically updated at a designated time every day. This time is specified by the **scheduledUpdateTime** field in the **form_config.json** file. For example, you can configure the widget to update at 10:30 every day. 6 7 8 ```json 9 { 10 "forms": [ 11 { 12 "name": "ScheduledUpdateTime", 13 "description": "$string:widget_scheupdatetime_desc", 14 "src": "./ets/scheduledupdatetime/pages/ScheduledUpdateTimeCard.ets", 15 "uiSyntax": "arkts", 16 "window": { 17 "designWidth": 720, 18 "autoDesignWidth": true 19 }, 20 "colorMode": "auto", 21 "isDefault": true, 22 "updateEnabled": true, 23 "scheduledUpdateTime": "10:30", 24 "updateDuration": 0, 25 "defaultDimension": "2*2", 26 "supportDimensions": [ 27 "2*2" 28 ] 29 } 30 ] 31 } 32 ``` 33 34- Setting multiple update times: The widget content will be automatically updated at several specific times every day. These times are specified by the **multiScheduledUpdateTime** field in the **form_config.json** file. For example, you can configure the widget to update at 11:30 and 16:30 every day. 35 ```json 36 { 37 "forms": [ 38 { 39 "name": "ScheduledUpdateTime", 40 "description": "$string:widget_scheupdatetime_desc", 41 "src": "./ets/scheduledupdatetime/pages/ScheduledUpdateTimeCard.ets", 42 "uiSyntax": "arkts", 43 "window": { 44 "designWidth": 720, 45 "autoDesignWidth": true 46 }, 47 "colorMode": "auto", 48 "isDefault": true, 49 "updateEnabled": true, 50 "scheduledUpdateTime": "10:30", 51 "multiScheduledUpdateTime": "11:30,16:30,", 52 "updateDuration": 0, 53 "defaultDimension": "2*2", 54 "supportDimensions": [ 55 "2*2" 56 ] 57 } 58 ] 59 } 60 ``` 61 62When a time-specific update is triggered, the system calls the [onUpdateForm](../reference/apis-form-kit/js-apis-app-form-formExtensionAbility.md#onupdateform) lifecycle callback of the FormExtensionAbility. In the callback, [updateForm](../reference/apis-form-kit/js-apis-app-form-formProvider.md#updateform) can be used to update the widget. For details about how to use onUpdateForm, see [Widget Lifecycle Management](./arkts-ui-widget-lifecycle.md). 63 64> **NOTE** 65> 1. If both interval-based updates (**updateDuration**) and time-specific updates (**scheduledUpdateTime**) are configured, the interval-based updates take precedence, and the time-specific updates will not be executed. To enable time-specific updates, set **updateDuration** to **0**. 66> 2. A maximum of 24 times can be set for **multiScheduledUpdateTime**. 67> 3. If both update at a single time and update at multiple times are configured, only the update at multiple times takes effect. 68> 4. To ensure backward compatibility, retain the **scheduledUpdateTime** parameter instead of deleting it. 69 70**Constraints** 71 72Time-specific updates are triggered only when the widget is visible. If the widget is invisible, the update action and data are recorded. The layout is refreshed once the widget becomes visible. 73