feat(date-picker): adds time-format prop (#5710)

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
jahnli 2024-03-11 18:21:18 +08:00 committed by GitHub
parent f1eaa48cba
commit f0f6f739ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 1 deletions

View File

@ -26,6 +26,7 @@
- `n-split` adds `panel1-class` `panel1-style` `panel2-class` `panel2-style` prop.
- `n-mention` adds `filter` method, closes [#5721](https://github.com/tusen-ai/naive-ui/pull/5721).
- `n-slider` aria support
- `n-date-picker` adds `time-format` prop.
## 2.38.1

View File

@ -26,6 +26,7 @@
- `n-split` 新增 `panel1-class` `panel1-style` `panel2-class` `panel2-style` 属性
- `n-mention` 新增 `filter` 方法,关闭 [#5721](https://github.com/tusen-ai/naive-ui/pull/5721)
- `n-slider` aria support
- `n-date-picker` 新增 `time-format` 属性
## 2.38.1

View File

@ -53,6 +53,7 @@ panel.vue
| show | `boolean` | `undefined` | Whether to show panel. | 2.28.3 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Date picker size. | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | Validation status. | 2.27.0 |
| time-format | `string \| undefined` | `undefined` | Format of the binding value. See [format](https://date-fns.org/v2.23.0/docs/format). | NEXT_VERSION |
| to | `string \| HTMLElement \| false` | `body` | Container node of the panel. `false` will keep it not detached. | |
| type | `'date' \| 'datetime' \| 'daterange' \| 'datetimerange' \| 'month' \| 'monthrange' \| 'year' \| 'quarter' \| 'week'` | `'date'` | Date picker type. | `'quarter'` v2.22.0, `'monthrange'` 2.28.3 |
| value | `number \| [number, number] \| null` | `undefined` | Value of the date picker when being manually set. | |

View File

@ -54,6 +54,7 @@ form-debug.vue
| show | `boolean` | `undefined` | 是否展示面板 | 2.28.3 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | 尺寸 | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | 验证状态 | 2.27.0 |
| time-format | `string \| undefined` | `undefined` | 设置面板中时间的显示方式,详情见 [format](https://date-fns.org/v2.23.0/docs/format) | NEXT_VERSION |
| to | `string \| HTMLElement \| false` | `body` | 面板的容器节点,`false` 会待在原地 | |
| type | `'date' \| 'datetime' \| 'daterange' \| 'datetimerange' \| 'month' \| 'monthrange' \| 'year' \| 'quarter' \| 'week'` | `'date'` | Date Picker 的类型 | `'quarter'` v2.22.0, `'monthrange'` 2.28.3 |
| value | `number \| [number, number] \| null` | `undefined` | Date Picker 的值 | |

View File

@ -1022,7 +1022,8 @@ export default defineComponent({
onNextMonth: this.onNextMonth,
onPrevMonth: this.onPrevMonth,
onNextYear: this.onNextYear,
onPrevYear: this.onPrevYear
onPrevYear: this.onPrevYear,
timeFormat: this.timeFormat
}
const renderPanel = (): VNode => {
const { type } = this