English
DateTimePicker
About 279 wordsLess than 1 minute
Introduction
The date and time picker component is used to select dates and times. It supports multiple formats (year-month-day, hour-minute-second), custom ranges, default values, and more.
Usage
Local import — configure it in the index.json of the page or component that needs it.
"usingComponents": {
"dialog-center": "ava-ui/fxui/DialogCenter/DialogCenter"
}import dialogSet from "ava-ui/fxui/DialogCenter/DialogSet";
dialogSet.dateTimePicker.show({
type:"day|time",
success:function(res){
console.log(res)
}
});Code demos
01 Component types
Default button
02 Hide the clear button
You can set the hideClearButton parameter to hide the clear button.
API
Parameters
| Parameter | Description | Type | Optional values | Default |
|---|---|---|---|---|
| type | Picker type | string | day|time / day / time / year / month / quarter | day |
| starttime | Start time | string | Format like 2000-01-01 00:00 | 1900-01-01 00:00 |
| endtime | End time | string | Format like 2030-12-31 23:59 | 2100-12-31 23:59 |
| backtime | Default display time | string | Format like 2022-05-20 12:00 | Current time |
| hideClearButton | Whether to hide the clear button | boolean | true / false | false |
| beforeSuccess | Pre-selection validation callback | function | Return true to prevent closing | - |
| success | Selection complete callback | function | result, formatRes | - |
| close | Close callback | function | - | - |
Events
| Event name | Description | Callback parameters |
|---|
