Closed (fixed)
Project:
FullCalendar
Version:
7.x-2.x-dev
Component:
Views
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
13 Jan 2012 at 12:23 UTC
Updated:
23 Dec 2013 at 04:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aspilicious commentedHeard this before. Let's try it....
Comment #2
aspilicious commentedOk we are going to fix this :).
In theme.inc we have
$entity->classand
We should add "fc-event-past" to entity->class if $date2 (== end date) < current date.
Probably there are date module functions for this. I'll ask Tim.
Sadly enough we can't do this in fullcalendar_fullcalendar_classes...
Comment #3
tim.plunkettSee attached.
There's no real easy way to expose what this class name should be, or if it should even be added, but this is fine.
Comment #4
pjcdawkins commentedThat patch works for me.
Comment #5
aspilicious commentedif we are going to do this I propose this code:
Comment #6
tim.plunkettI don't agree. With this code, it will only happen if you refresh the page on the EXACT second the event ends, not if you're in the middle of the event.
If we really want to add a bunch more code, we can figure out if we're in the middle of the event or not...
Comment #7
aspilicious commentedAre you sure?
In the second test I use the start date of the event. So when you're in the middle it will choose 'fc-event-now'
Comment #8
tim.plunkettOh my brain/eyes skipped that part. Yeah I guess that's okay with me. Want to reroll?
Comment #9
aspilicious commentedTomorow, need some sleep :)
Comment #10
pjcdawkins commentedWell I don't know if this is the right etiquette but while you were sleeping I made a patch. I need more practice than you do. It's based on, but not identical, to #5.
Comment #11
tim.plunkettI like the use of REQUEST_TIME, forgot about that.
should be
elseifCan you reroll again? More practice ;)
Comment #12
pjcdawkins commentedRerolled
Comment #13
pjcdawkins commentedWe need to check for all day events.
Comment #14
aspilicious commentedWhat if I have an $all_day date in the past that will fail.
$all_day is an event that last one day (24 hours)
Comment #15
pjcdawkins commentedOh good point! Something like...
Comment #16
aspilicious commenteddo we cover all day events that are happening now? ;)
Comment #17
pjcdawkins commentedThey'll be "now" by default, surely, because the start time will be < REQUEST_TIME and > midnight. I think it actually has to be:
Comment #18
aspilicious commentedIf you reroll I'll test it. Tim has to decide if we want to add these extra classes and code...
Comment #19
pjcdawkins commentedSure. There's another problem: events with no end date are assumed to have 0 duration, whereas the default duration should really be read from the FullCalendar settings... I think that should be dealt with in
_fullcalendar_process_dates(), unless the Date module has a default duration setting somewhere that I've missed.Comment #20
pjcdawkins commentedThe feature seemed simple when I opened the thread!... Marking needs work for #19, attaching a patch for other work up to #17.
Comment #21
tim.plunkettAccording to http://www.php.net/manual/en/datetime.formats.relative.php, it can just be strtotime('today').
I don't like wrapping code unless it's REALLY long, let's keep this on one line.
Comment #22
pjcdawkins commentedOK, I've updated the patch. I haven't found a standard for giving events a default duration (where there is no end date specified), so I'm not sure how to proceed with #19.
Comment #23
tim.plunkettBy default, FullCalendar shows events with the same start/end as 2 hours long. That's configurable via the FullCalendar Options module.
Not sure that it really matters.
Comment #24
pjcdawkins commentedWell, I don't think it matters that the time classes should respect default durations, it only affects events without end times set, only shortly after they've started, and only for those actually using these classes for styling. And this whole issue is minor anyway. And I'm using the patch in #22 successfully, in production.
Comment #25
tim.plunkettSorry for the insane delays.
Committed, thanks!
http://drupalcode.org/project/fullcalendar.git/commit/bc205ca