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

feat: Fix compatibility with new antd v5.14.0 DatePicker refactors #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amir2mi
Copy link

@amir2mi amir2mi commented Feb 24, 2024

This pull request includes updating package antd version to 5.14.2, which fix compatibility issues with newly refactored <DatePicker /> component as mentioned here: ant-design/ant-design#46982

As I installed antd version 5.14.2, antd-jalali stopped working and this error was thrown:

Compiled with problems:

ERROR in src/jalali/generateJalaliConfig.ts:52:7

TS2739: Type '{ getNow: () => Dayjs; getFixedDate: (string: string) => Dayjs; getEndDate: (date: Dayjs) => Dayjs; getWeekDay: (date: Dayjs) => number; getYear: (date: Dayjs) => number; ... 16 more ...; locale: { ...; }; }' is missing the following properties from type 'GenerateConfig<Dayjs>': getMillisecond, setMillisecond
    50 | };
    51 |
  > 52 | const generateJalaliConfig: GenerateConfig<Dayjs> = {
       |       ^^^^^^^^^^^^^^^^^^^^
    53 |   // get
    54 |   getNow: () => dayjs(),
    55 |   getFixedDate: (string) => dayjs(string, "YYYY-MM-DD"),

I fixed it by defining the getMillisecond and setMillisecond in generateJalaliConfig, (src/jalali/generateJalaliConfig.ts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant