nhn / tui.calendar

🍞📅A JavaScript calendar that has everything you need.
http://ui.toast.com/tui-calendar
MIT License
11.99k stars 1.29k forks source link

Question: Is it possible to create/drag events to 15/45mins past the hour #187

Open NoelOConnell opened 6 years ago

NoelOConnell commented 6 years ago

Currently when creating an event you can click on the calendar and create events on the hour or 30mins past.

Is it possible to create events at other times like 15mins past or 45mins past? Dragging an event only allows for events at the hour or 30mins past also.

Any suggestions on the best way to handle these cases? Thanks

youjung-hong commented 6 years ago

Hello, Noel :)

It seems very useful to set 15/30/45/60min!! There is someone that request the same feature(WoW) You can check this at #175.

Thank you

NoelOConnell commented 6 years ago

Thanks,

I took a look at how to change this setting.

In core.js the _calcGridYIndex function returns a decimal which decides whether the event will be at 60mins or 30mins.

I replaced that function with this version:

_calcGridYIndex: function(baseMil, height, y) {
    // get ratio from right expression > point.y : x = session.height : baseMil
    // and convert milliseconds value to hours.
    var result = datetime.millisecondsTo('hour', (y * baseMil) / height),
    floored = result | 0,
    nearest = common.nearest(result - floored, [0.25, 0.5, 0.75, 1]);

    return floored + nearest;        
}

It now returns a decimal to the nearest quarter. So the event can now be dragged to 15/30/45/60 mins. Hope that helps.

calendar-intervals

dongsik-yoo commented 6 years ago

@NoelOConnell Thank you for your good suggestion. Can you send us PR please? Because it's your achievement for tui-calendar. I'll really appreciate it.

matthiasg commented 5 years ago

@NoelOConnell will you open a PR ?

NoelOConnell commented 5 years ago

@matthiasg The edits I suggested above worked for me for my specific use case.

Currently the default is events in 30 minute blocks, changing that behaviour could effect existing implementations that relied on that.

A better option would be to this configurable so you could set at what minutes on the hour a time slot can start at. eg every 5 minutes or only every 15 minutes.

Also, my case raised some usability issues. When the default is every 30 minutes, it was obvious to the user what time was being selected. When the slots more frequent, it was very hard to know if you were selecting 1:10pm or 1:15pm etc. I made some more adjustments using the guideElement to highlight on hover, what the current time selected would be.

matthiasg commented 5 years ago

@NoelOConnell I was wondering about the usability aspect, would likely only be solved well by redefining the slot height and also adding some visual feedback like a popup to show the exact time.

NoelOConnell commented 5 years ago

Below is an example of the visual feedback I chose to give when hovering over time slots. The user can see what time would be selected. It's not ideal in all case but worked for me.

By default it highlights 30 minute slots but the user can click and drag to create larger time slots. Maybe a variation of the current time indicator might be better?

select-time-slot

jjohnson1994 commented 5 years ago

Hello,

I'm looking for this feature as well, really like the look of the hover on the 30 min time slots. Weirdly that's exactly what I need in my app. Do you think you'll be doing a pull request? If not, please, could you share you code?

NoelOConnell commented 5 years ago

I made the changes in a forked version so you can see what was required.

It was hacked together to get it working the way I wanted. More consideration would be needed to make it configurable before making any pull request.

Feel free to look at the changes and see how it works.

If you fork and run my version you can see the guide appearing when hovering and the ability to select events every 15 minutes

mariusa commented 5 years ago

Hi, would you please consider implementing this in the main calendar, instead of a fork? It's very useful.

dongsik-yoo commented 5 years ago

@mariusa I agree with you. TOAST UI Calendar v2.0 has been planning this functionality.

johnnyBarendrecht commented 4 years ago

Hi, Our company is using the TOAST UI Calendar and we were wondering if there is an update on this functionality. Or when v2.0 will come out?

Thanks

gregoryforel commented 3 years ago

Hi @dongsik-yoo , This feature would be fantastic. I am planning to use TUI Calendar for a doctor appointment booking app, and many doctors need a 45mn standard appointment. I am pretty sure many other businesses would benefit greatly from a configurable drag event. Is there an update? Happy new year

jungeun-cho commented 3 years ago

@johnnyBarendrecht , @gregoryforel Our team members are working on different projects...

2.0 will probably come out this year. (at all costs!)

I'm sorry for late reply.

Happy new year :)

kino90 commented 2 years ago

Hi. Any update on this? Is the project still active?

adhrinae commented 2 years ago

@kino90 The project is still active as you can see. However, we don't have a plan to implement this feature yet.

kino90 commented 2 years ago

Yes, I see the project is still active and I'm happy about that, it's a really nice project!

Why isn't that planned, if I could ask? Does it break something? Because that looks a pretty "quick and easy" feature from outside, and that could be very useful to many people!

adhrinae commented 2 years ago

@kino90 The team behind TOAST UI products is not developing TOAST UI only. So it's tough to share the roadmap in general. Please understand that.

On the other hand, I'll review the best I can when someone uploads a PR for a new feature. Or someone else can fork the repository and modify this project for their own use cases.

mohitkota2003 commented 10 months ago

@dongsik-yoo , Hey team can i know the expected time for this feature to see in the release , actually we need this feature on a priority basis , it will be helpfull if we could see this feature in a week .

@NoelOConnell @mariusa @kino90 @gregoryforel

mpsijm commented 10 months ago

@mohitkota2003 (and others): it looks like PR #1426 implements this feature :smile: It should be possible to use it already, if you don't mind fiddling a bit with Git forks :slightly_smiling_face: