Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复禁用日期格式化问题 #1618

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/date-picker/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import chunk from 'lodash/chunk';
import { parseToDayjs } from './format';

dayjs.extend(weekOfYear);
dayjs.extend(weekYear);
Expand Down Expand Up @@ -476,7 +477,7 @@ export function isEnabledDate({

// 禁用日期,示例:['A', 'B'] 表示日期 A 和日期 B 会被禁用。
if (Array.isArray(disableDate)) {
const formattedDisabledDate = disableDate.map((item: string) => dayjs(item, format));
const formattedDisabledDate = disableDate.map((item: string) => parseToDayjs(item, format));
// eslint-disable-next-line
const isIncludes = formattedDisabledDate.some(item => item.isSame(dayjs(value)));
return !isIncludes;
Expand Down
Loading