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

shifts that go past midnight not rendered correctly #179

Open
jcam opened this issue Aug 9, 2019 · 3 comments
Open

shifts that go past midnight not rendered correctly #179

jcam opened this issue Aug 9, 2019 · 3 comments

Comments

@jcam
Copy link

jcam commented Aug 9, 2019

Current issues:

  • When shifts start before midnight and end after midnight, they just wrap off the edge of the viewport.
  • When a 'repeated' shift starts after midnight, it shows on the current day instead of the next day.

Preferred state:

  • When a shift starts before midnight and ends after midnight, the bar should end at midnight, and then it should appear on the following day starting at midnight and going until shift end.
  • When a repeated shift starts after midnight, it should show on the following day.
@jcam
Copy link
Author

jcam commented Aug 9, 2019

I tried to hack at the first item a bit, to set a day to display date->subDay()'s shifts when end time < start time.
It appeared to work, but with a complicated schedule, everything kinda blew up and it displayed things in all the wrong places.

here's what i'd added:
@foreach($schedule->slots->where('start_date', $day->date->subDays(1)->format('Y-m-d'))->filter(function ($item){return $item->end_time < $item->start_time;}) as $slot)
@include('partials/event/slotwrap')
@Endforeach

slotwrap is identical to slot, except for the span it has the data-start set to 0:00:00 and the data-duration set to end_time

@itsrachelfish
Copy link
Member

@jcam Can you provide an example of the shift you are trying to create? What start time and shift duration are you using? And what department needs repeating shifts past midnight? I'm assuming rangers or medical?

@jcam
Copy link
Author

jcam commented Aug 22, 2019

We have sound monitor shifts that are 12 hour shifts starting at 10am/10pm. Rangers has 6 hour khaki shifts that start at odd times too.

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