ember-calendar icon indicating copy to clipboard operation
ember-calendar copied to clipboard

Any way to use it as full day? 24 hours? It's not working when you set it as 24 hours.

Open jfrux opened this issue 6 years ago • 8 comments

00:00:00 to 23:59:59

Ideally, my situation is that I need to be able to schedule 24/7.

This addon is great, I might have to just add it if not. Anybody have any ideas of how I could accomplish this?

jfrux avatar Mar 09 '18 23:03 jfrux

We have something similar to this in our application. I can share our implementation details for you.

willrax avatar Mar 11 '18 18:03 willrax

Nice! That would be awesome!

-- Joshua F. Rountree | UX Developer The E.W. Scripps Company 312 Walnut Street, Suite 2800, Floor 29th, Office 29W109 Cincinnati, Ohio 45202-4024 (513) 977-3840 (office, M-F, 7a-4p) (513) 827-7936 (mobile)

On Mar 11, 2018, 2:50 PM -0400, Will Raxworthy [email protected], wrote:

We have something similar to this in our application. I can share our implementation details for you. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jfrux avatar Mar 12 '18 02:03 jfrux

here's what we have:

{{#as-calendar
  title="Calendar"
  dayStartingTime="00:00"
  dayEndingTime="24:00"
  occurrences=occurrences
  startFromDate=true
  timeSlotHeight="25"
  timeSlotDuration="0:30"
  onAddOccurrence=(action "calendarAddTimeslot") as |occurrence options|}}
{{!-- some other stuff --}}
{{/as-calendar}}

willrax avatar Mar 12 '18 09:03 willrax

This shows the following:

screen shot 2018-03-12 at 09 33 09

willrax avatar Mar 12 '18 09:03 willrax

I think I've got it working... But I've done some alterations to the plugin to get what I needed out of it but I'm getting another issue relating to the very top event being duped to the previous day. image

I can't see how its adding it to the previous day with the occurrences filter doing isSameOrAfter && isSameOrBefore

jfrux avatar Mar 12 '18 12:03 jfrux

Ah yeah. We had that as well.

If i remember correctly, the reason it's happening is because moment treats 00:00 as both the current day and the day before. We never really found a way to tackle it. We tried adding a second to the time. Would love to make the implementation smarter or use something that doesn't treat 00:00 as two days.

willrax avatar Mar 12 '18 14:03 willrax

So maybe we need to do some hackiness to hide the duped instance for now I suppose. I’m sure I’ll figure out a way to rig it up soon haha. Thanks!

-- Joshua F. Rountree | UX Developer The E.W. Scripps Company 312 Walnut Street, Suite 2800, Floor 29th, Office 29W109 Cincinnati, Ohio 45202-4024 (513) 977-3840 (office, M-F, 7a-4p) (513) 827-7936 (mobile)

On Mar 12, 2018, 10:14 AM -0400, Will Raxworthy [email protected], wrote:

Ah yeah. We had that as well. If i remember correctly, the reason it's happening is because moment treats 00:00 as both the current day and the day before. We never really found a way to tackle it. We tried adding a second to the time. Would love to make the implementation smarter or use something that doesn't treat 00:00 as two days. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jfrux avatar Mar 12 '18 14:03 jfrux

We ended up not worrying about it because the majority of our scheduling is during work hours. Let me know if you figure something out though and we can try to incorporate it in!

willrax avatar Mar 12 '18 14:03 willrax