From 6a16e19b37efee46b8379274a7bd67d126b1bc47 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 22:57:14 +0800 Subject: [PATCH] fix: moment ts error --- components/calendar/Header.tsx | 1 + components/date-picker/props.ts | 1 + components/date-picker/utils.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 8f5290fd9..4f1440640 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -4,6 +4,7 @@ import { Group, Button } from '../radio'; import PropTypes from '../_util/vue-types'; import { defaultConfigProvider } from '../config-provider'; import { VueNode } from '../_util/type'; +import moment from 'moment'; function getMonthsLocale(value: moment.Moment): string[] { const current = value.clone(); diff --git a/components/date-picker/props.ts b/components/date-picker/props.ts index 73efeb50a..621d033af 100644 --- a/components/date-picker/props.ts +++ b/components/date-picker/props.ts @@ -1,4 +1,5 @@ import { PropType } from 'vue'; +import moment from 'moment'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { tuple } from '../_util/type'; diff --git a/components/date-picker/utils.ts b/components/date-picker/utils.ts index 61d96d7d7..149c7be42 100644 --- a/components/date-picker/utils.ts +++ b/components/date-picker/utils.ts @@ -1,3 +1,5 @@ +import moment from 'moment'; + type Value = moment.Moment | undefined | null; type Format = string | string[] | undefined | ((val?: Value) => string | string[] | undefined); export function formatDate(value: Value, format: Format) {