tui.calendar icon indicating copy to clipboard operation
tui.calendar copied to clipboard

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

Open NoelOConnell opened this issue 5 years ago • 20 comments

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

NoelOConnell avatar Aug 21 '18 11:08 NoelOConnell

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

youjung-hong avatar Aug 22 '18 10:08 youjung-hong

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

NoelOConnell avatar Aug 28 '18 11:08 NoelOConnell

@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.

dongsik-yoo avatar Sep 04 '18 03:09 dongsik-yoo

@NoelOConnell will you open a PR ?

matthiasg avatar Jan 29 '19 16:01 matthiasg

@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.

NoelOConnell avatar Jan 29 '19 21:01 NoelOConnell

@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.

matthiasg avatar Jan 30 '19 10:01 matthiasg

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

NoelOConnell avatar Jan 30 '19 11:01 NoelOConnell

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?

jjohnson1994 avatar Jan 30 '19 11:01 jjohnson1994

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

NoelOConnell avatar Jan 30 '19 16:01 NoelOConnell

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

mariusa avatar Sep 17 '19 10:09 mariusa

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

dongsik-yoo avatar Sep 17 '19 10:09 dongsik-yoo

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

johnnyBarendrecht avatar Feb 25 '20 13:02 johnnyBarendrecht

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

gregoryforel avatar Jan 09 '21 19:01 gregoryforel

@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 :)

jungeun-cho avatar Jan 13 '21 03:01 jungeun-cho

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

kino90 avatar Jul 29 '22 09:07 kino90

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

adhrinae avatar Jul 31 '22 23:07 adhrinae

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!

kino90 avatar Aug 01 '22 05:08 kino90

@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.

adhrinae avatar Aug 01 '22 06:08 adhrinae

@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

mohitkota2003 avatar Dec 25 '23 13:12 mohitkota2003

@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:

mpsijm avatar Jan 06 '24 13:01 mpsijm