From cbc580aacd10fb3f65c33ddb7655ebfe711bcb6d Mon Sep 17 00:00:00 2001 From: AM_smart <330595524@qq.com> Date: Tue, 20 Oct 2020 17:15:29 +0800 Subject: [PATCH] Update Date.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat:新增月份显示渲染器,并修改对应examples --- src/renderers/Date.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/renderers/Date.tsx b/src/renderers/Date.tsx index 7dafe209e..33c59b2a4 100644 --- a/src/renderers/Date.tsx +++ b/src/renderers/Date.tsx @@ -119,3 +119,13 @@ export class TimeFieldRenderer extends DateField { format: 'HH:mm' }; } +@Renderer({ + test: /(^|\/)month$/, + name: 'month-field' +}) +export class MonthFieldRenderer extends DateField { + static defaultProps: Partial = { + ...DateField.defaultProps, + format: 'MM' + }; +}