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: Allow presetDates values to be functions #1037

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

Conversation

ayrtonandino
Copy link

Describe your changes

Update DatepickerMenu to allow the function presetDate to recibe a MaybeRefOrGetter<Date[] | string[] | string | Date> from PresetDate.

Update the PresetDate interface present in interfaces.ts, to use type MaybeRefOrGetter from vue

Update package.json, set peerDependencies to the minimun required vue 3.3.0 (required by MaybeRefOrGetter)

Add 2 new tests, fixed 1:

  • Should preset range from preset-dates now click on the preset instead of calling its internal function presetDate
  • add new test Should preset range from preset-dates when range its a function, check when value is a function, it should behave same as before
  • add new test Should correctly set today when preset-dates its a function and selected 2 days later, check that presetDate is executed when pressed, in this case 2 days latter, and returns the correct date, and not the date of when it was mounted.

Issue ticket number and link

Solves #1031

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have ensured that unit tests pass without errors
  • If it is a new feature, I have added a new unit test
  • update documentation

Dont know how to update the documentation, interface should be updated to the new MaybeRefOrGetter value, and maybe encorage to use functions instead of hard coded values.

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.

1 participant