tomosterlund / qalendar

Event calendar and date picker for Vue 3
https://tomosterlund.github.io/qalendar/
MIT License
269 stars 53 forks source link

Clicking on the calendar view (day, week views) only references date, not time #169

Open shamime opened 1 year ago

shamime commented 1 year ago

Right now according to the documentation, there is no way to find out the time user clicked in the calendar view - only date is getting referenced. Are there plans to enable time to be returned in the click event? Any workaround possible to achieve this result? That would be useful if the app wants to implement the functionality to create an event right from the calendar view.

Thank you!!

tomosterlund commented 1 year ago

This could be a good feature to enable by default. I'll add it to the roadmap. Feel free to suggest how the api should look for this.

Meanwhile, there is actually a way to achieve something similar. For this, however, you need to use the intervals feature: https://tomosterlund.github.io/qalendar/guide.html#intervals

shamime commented 1 year ago

Thank you @tomosterlund for your response! The way I actually envisioned the API is as simple as it sounds - allow click event to propagate passing date/time into an event listener when user clicks anywhere on the calendar view. It could be as basic as just recognizing start date/time in the day/week view (date in the month view perhaps). And if there is a need to be more sophisticated - the calendar can allow for predefined interval to be initiated upon a click (I believe this is what you are referring to). My idea is while using intervals is totally suitable, it requires some additional setup, which could be made optional (with certain assumptions like duration for example). Again, just having start date/time passed into click event would be a great starting point for this feature. Thank you!