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: expose internal date utils functions #831

Merged
merged 16 commits into from
Apr 8, 2024

Conversation

epr3
Copy link
Collaborator

@epr3 epr3 commented Apr 7, 2024

Hello,

This PR exposes some of the functions used internally in the Calendar/Date Field components for creating months/years/decades, determining the types of DateValue objects and comparison functions.

These functions might prove useful for users who might want to build more complicated Calendar-type components and having these utilities might help with the manipulation of the placeholder/modelValue and/or building more complex Calendar grids.

@zernonia
Copy link
Collaborator

zernonia commented Apr 7, 2024

Thanks @epr3 ! I like the idea of exposing these utility. However I'm not sure we should expose it as a composable (useXXX). As the term use mostly ties with composable that utilize Vue reactivity, like how it does in VueUse.

I think for clarity sake we can rename useDateUtils to dateUtility.
or maybe we expose this utility as such radix-vue/date? WDYT?

@epr3
Copy link
Collaborator Author

epr3 commented Apr 7, 2024

Hello @zernonia,

Both variants sound very good for me.

Let me know what updates should I do to this PR.

@zernonia
Copy link
Collaborator

zernonia commented Apr 7, 2024

@epr3 I'm leaning toward radix-vue/date. This way all Dates related utility, types, function & composable can be moved there. Though it might have some breaking change as the import path will be different now, but since it is still in alpha tag, it should be quick and easy update for folks.

@epr3
Copy link
Collaborator Author

epr3 commented Apr 7, 2024

@zernonia Will add a new folder under packages/plugins and move everything Date related there.

@zernonia zernonia merged commit a3b9816 into radix-vue:main Apr 8, 2024
2 of 3 checks passed
@epr3 epr3 deleted the feat-date-utils branch April 10, 2024 14:58
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

2 participants