diff --git a/components/date-picker/generatePicker/interface.ts b/components/date-picker/generatePicker/interface.ts index 426d32fa1..75bcf6acc 100644 --- a/components/date-picker/generatePicker/interface.ts +++ b/components/date-picker/generatePicker/interface.ts @@ -47,6 +47,7 @@ export type AdditionalPickerLocaleLangProps = { monthPlaceholder?: string; weekPlaceholder?: string; rangeYearPlaceholder?: [string, string]; + rangeQuarterPlaceholder?: [string, string]; rangeMonthPlaceholder?: [string, string]; rangeWeekPlaceholder?: [string, string]; rangePlaceholder?: [string, string]; diff --git a/components/date-picker/locale/en_GB.tsx b/components/date-picker/locale/en_GB.tsx index e359de872..65b15548b 100644 --- a/components/date-picker/locale/en_GB.tsx +++ b/components/date-picker/locale/en_GB.tsx @@ -12,6 +12,7 @@ const locale: PickerLocale = { weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], + rangeQuarterPlaceholder: ['Start quarter', 'End quarter'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], ...CalendarLocale, diff --git a/components/date-picker/locale/en_US.tsx b/components/date-picker/locale/en_US.tsx index 0b09c56ce..0bcdfc616 100644 --- a/components/date-picker/locale/en_US.tsx +++ b/components/date-picker/locale/en_US.tsx @@ -12,6 +12,7 @@ const locale: PickerLocale = { weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], + rangeQuarterPlaceholder: ['Start quarter', 'End quarter'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], ...CalendarLocale, diff --git a/components/date-picker/locale/zh_CN.tsx b/components/date-picker/locale/zh_CN.tsx index ab9a5c760..5a2afece0 100644 --- a/components/date-picker/locale/zh_CN.tsx +++ b/components/date-picker/locale/zh_CN.tsx @@ -13,6 +13,7 @@ const locale: PickerLocale = { rangePlaceholder: ['开始日期', '结束日期'], rangeYearPlaceholder: ['开始年份', '结束年份'], rangeMonthPlaceholder: ['开始月份', '结束月份'], + rangeQuarterPlaceholder: ['开始季度', '结束季度'], rangeWeekPlaceholder: ['开始周', '结束周'], ...CalendarLocale, }, diff --git a/components/date-picker/locale/zh_TW.tsx b/components/date-picker/locale/zh_TW.tsx index 2a84a772c..b9fa07006 100644 --- a/components/date-picker/locale/zh_TW.tsx +++ b/components/date-picker/locale/zh_TW.tsx @@ -13,6 +13,7 @@ const locale: PickerLocale = { rangePlaceholder: ['開始日期', '結束日期'], rangeYearPlaceholder: ['開始年份', '結束年份'], rangeMonthPlaceholder: ['開始月份', '結束月份'], + rangeQuarterPlaceholder: ['開始季度', '結束季度'], rangeWeekPlaceholder: ['開始周', '結束周'], ...CalendarLocale, }, diff --git a/components/vc-picker/RangePicker.tsx b/components/vc-picker/RangePicker.tsx index 523c7771f..cba4984b4 100644 --- a/components/vc-picker/RangePicker.tsx +++ b/components/vc-picker/RangePicker.tsx @@ -993,7 +993,9 @@ function RangerPicker() { arrowLeft > panelDivRef.value.offsetWidth - arrowRef.value.offsetWidth - - (direction === 'rtl' ? 0 : arrowRef.value.offsetLeft) + (direction === 'rtl' || arrowRef.value.offsetLeft > arrowLeft + ? 0 + : arrowRef.value.offsetLeft) ) { panelLeft = arrowLeft; } diff --git a/components/vc-picker/generate/dayjs.ts b/components/vc-picker/generate/dayjs.ts index 3740b1609..ab817fda2 100644 --- a/components/vc-picker/generate/dayjs.ts +++ b/components/vc-picker/generate/dayjs.ts @@ -28,9 +28,70 @@ dayjs.extend((_o, c) => { type IlocaleMapObject = Record; const localeMap: IlocaleMapObject = { + // ar_EG: + // az_AZ: + // bg_BG: + bn_BD: 'bn-bd', + by_BY: 'be', + // ca_ES: + // cs_CZ: + // da_DK: + // de_DE: + // el_GR: en_GB: 'en-gb', en_US: 'en', + // es_ES: + // et_EE: + // fa_IR: + // fi_FI: + fr_BE: 'fr', // todo: dayjs has no fr_BE locale, use fr at present + fr_CA: 'fr-ca', + // fr_FR: + // ga_IE: + // gl_ES: + // he_IL: + // hi_IN: + // hr_HR: + // hu_HU: + hy_AM: 'hy-am', + // id_ID: + // is_IS: + // it_IT: + // ja_JP: + // ka_GE: + // kk_KZ: + // km_KH: + kmr_IQ: 'ku', + // kn_IN: + // ko_KR: + // ku_IQ: // previous ku in antd + // lt_LT: + // lv_LV: + // mk_MK: + // ml_IN: + // mn_MN: + // ms_MY: + // nb_NO: + // ne_NP: + nl_BE: 'nl-be', + // nl_NL: + // pl_PL: + pt_BR: 'pt-br', + // pt_PT: + // ro_RO: + // ru_RU: + // sk_SK: + // sl_SI: + // sr_RS: + // sv_SE: + // ta_IN: + // th_TH: + // tr_TR: + // uk_UA: + // ur_PK: + // vi_VN: zh_CN: 'zh-cn', + zh_HK: 'zh-hk', zh_TW: 'zh-tw', }; @@ -47,7 +108,7 @@ const parseNoMatchNotice = () => { const generateConfig: GenerateConfig = { // get getNow: () => dayjs(), - getFixedDate: string => dayjs(string, 'YYYY-MM-DD'), + getFixedDate: string => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']), getEndDate: date => date.endOf('month'), getWeekDay: date => { const clone = date.locale('en'); diff --git a/components/vc-picker/index.tsx b/components/vc-picker/index.tsx index 407490a3e..f19321961 100644 --- a/components/vc-picker/index.tsx +++ b/components/vc-picker/index.tsx @@ -1,4 +1,4 @@ -// 2.6.4 +// 2.6.7 import type { PickerProps } from './Picker'; import Picker from './Picker'; import PickerPanel from './PickerPanel'; diff --git a/components/vc-picker/locale/pt_PT.ts b/components/vc-picker/locale/pt_PT.ts index 86a9a64cc..3c3c642c2 100644 --- a/components/vc-picker/locale/pt_PT.ts +++ b/components/vc-picker/locale/pt_PT.ts @@ -27,6 +27,8 @@ const locale: Locale = { nextDecade: 'Década seguinte', previousCentury: 'Século anterior', nextCentury: 'Século seguinte', + shortWeekDays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'], + shortMonths: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], }; export default locale;