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

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

Open
jfrux opened this issue Mar 9, 2018 · 8 comments

Comments

@jfrux
Copy link

jfrux commented Mar 9, 2018

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?

@willrax
Copy link
Contributor

willrax commented Mar 11, 2018

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

@jfrux
Copy link
Author

jfrux commented Mar 12, 2018 via email

@willrax
Copy link
Contributor

willrax commented Mar 12, 2018

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
Copy link
Contributor

willrax commented Mar 12, 2018

This shows the following:

screen shot 2018-03-12 at 09 33 09

@jfrux
Copy link
Author

jfrux commented Mar 12, 2018

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

@willrax
Copy link
Contributor

willrax commented Mar 12, 2018

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.

@jfrux
Copy link
Author

jfrux commented Mar 12, 2018 via email

@willrax
Copy link
Contributor

willrax commented Mar 12, 2018

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!

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

No branches or pull requests

2 participants