fullcalendar / fullcalendar

Full-sized drag & drop event calendar in JavaScript
https://fullcalendar.io
MIT License
18.55k stars 3.61k forks source link

ClassName for all-day events #474

Open arshaw opened 9 years ago

arshaw commented 9 years ago

Originally reported on Google Code with ID 203

Hi Adam,
I am using fullcalendar-1.4.1. I am sending a JSON string from a servlet 
and trying to get fullCalendar to display this in agendaday view with 
start and end times.

The final JSON string fed to FullCal is below:

[ { "title": "testevent1", "allDay": "false", "start": "Sat, 21 Nov 2009 
13:00:00 EST", "end": "Sat, 21 Nov 2009 14:00:00 EST" } ] 

This is a single event on 21-Nov, from 01:00 PM EST to 02:00 PM EST and is 
NOT AN ALL DAY event.

My problem is full cal reads this event as starting as an all day event 
spanning for 2 days, from 21-Nov to 22 Nov. Pls. check the screenshot 
attached so you'll understand what I mean. 

I am not sure what I am doing wrong. Could you pls. help?

I am also attaching the source file that I am using to read these events. 

Thanks,
Cyriac Peter

Reported by cyriacpeter on 2009-11-21 14:27:04


Imported with 3 stars.

arshaw commented 9 years ago
"true" should not be a string, rather just a normal javascript true (no quotes)

Reported by adamrshaw on 2009-11-21 17:22:53

arshaw commented 9 years ago
Thanks a lot Adam. 

There were two issues. 

1) I was passing the allDay boolean value as a quoted string. This is corrected. 

2) This was a data issue. My event time was 1PM EST 21-Nov to 2PM EST 21-Nov. 
Converted to IST, this is from 11:30PM 21-Nov to 12:30AM 22-Nov. Consequently, the

Month view shows 2 events one on 21-Nov and another on 22-Nov.

I am exploring the tool to see if there is a way to give a different color 
highlighting for events that span allDay compared to other normal events - so that

the month view itself distinguishes b/w all day events and normal events.

Thanks and regards,
Cyriac 

Reported by cyriacpeter on 2009-11-23 08:15:50

arshaw commented 9 years ago
in the future, i might put a special css class on all-day events, but you can achieve
this right now w/ eventRender:

eventRender: function(event, element) {
   if (event.allDay) {
      element.addClass('all-day-event');
   }
}

let me know if this helps

Reported by adamrshaw on 2009-11-27 21:50:28

arshaw commented 9 years ago

Reported by adamrshaw on 2009-11-27 21:51:09

arshaw commented 9 years ago

Reported by adamrshaw on 2010-01-20 05:33:08

arshaw commented 9 years ago
eventRender: function(event, element) {
   if (event.allDay) {
      element.addClass('all-day-event');
   }
}

This code does not work.

Reported by ajaygiri1379 on 2010-07-30 11:47:10

arshaw commented 9 years ago
ajaygiri1379, please enter a new issue and follow the instructions on how to include
a demo (on Support page)

Reported by adamrshaw on 2010-08-26 05:04:15

arshaw commented 9 years ago

Reported by adamrshaw on 2013-08-14 05:49:52

arshaw commented 9 years ago
Issue 1664 has been merged into this issue.

Reported by adamrshaw on 2013-08-18 19:05:40

arshaw commented 9 years ago
Issue 1846 has been merged into this issue.

Reported by adamrshaw on 2013-08-19 02:12:10