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: allow to use ReadonlyDate in ConfigType #2751

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

Conversation

jakubhonisek
Copy link

Summary

This pull request introduces support for the ReadonlyDate type as a valid input for the dayjs() function. The ReadonlyDate type excludes all setter methods from the native Date object, ensuring immutability.

The aim is to allow dates that are typed as ReadonlyDate in projects to be directly passed to the dayjs() function without compatibility issues.

Benefits

  • Compatibility with Immutable Dates: Developers can now use ReadonlyDate objects (which exclude setter methods for immutability) as input to the dayjs() function, ensuring smooth integration with projects that require or enforce readonly types.

Impact

  • No Breaking Changes: Existing code using Date and other types as input to dayjs() will continue to work as expected.
  • Enhanced Flexibility: This change allows developers who use ReadonlyDate in their projects to seamlessly integrate dayjs() without needing to cast or modify their date types.

@martynasoroka
Copy link

Nice job Kuba! I really need this change for my personal project, I hope it will be released soon 😄

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.

2 participants