I was just curious about all day events, I'm not sure if I'm missing something. Is it possible to just not show the time (12:00am-11:59pm) for an all day event?
I did research on this because I noticed when I switched to 12hr format there seemed to be a problem. I searched and learned that it was a bug in 5.x-1.x, so I switched over to the 5.x-2.x-dev to test it out.
I got to thinking why keep track of the hours at all for an all day event? I'm not sure what the ical standard is for handling this. It seems like you wouldn't need to worry about a start and end time at all but rather have a flag for "all day".
Anyways, if it's possible to simply hide the times on an event that is "12:00am-11:59pm" I'd like to know.. thanks. Also if I'd like to help where's the best place to start?
Eric
Comments
Comment #1
goose2000 commentedMe too, I do not need those times showing up for all day events, clutter. And confuses people at first. I'm looking at it now...
John A
Comment #2
ecarter commentedAfter testing specific cases, I found that "all day" does appear on the calendar if you use 24hr format. However if I use 12hr format, then checking "All Day" at the top of a new content type seems to be only the current hour. In my case it shows:
TEST 12hr Format All Day
Start: 12:00 pm
End: 12:59 pm
Where if you have 24hr format selected, you see:
TEST 24hr Format All Day
all day
Eric
Comment #3
ecarter commentedAfter tinkering with this a bit, I think I found where the issue is. I'm a bit rusty with my javascript so maybe someone can chime in.
What I found was that the "End Date" is set to "12" for hour and "59" for minutes when "All Day" is selected in 12 hour mode.
Also, the hours go from "00" to "12" in 12 hour mode, presumably this should be 01-12.
Here's the code I found that generates the hours in the event module itself (event.module) on line 1478:
So if we changed
for ($i = 0; $i <= 12; $i++)tofor ($i = 1; $i <= 12; $i++)then it will count from 1 through 12.As for the all day module, I found that if I added:
Then I could use different javascript files for the time notation. I tried working with it and changed the end time:
However, I couldn't quite figure out how to change the start_ampm and end_ampm with javascript as they had no CSS id's. Not sure where that's defined.
One other thing I've noticed in troubleshooting this is that when I select "12am" as the start time it is converted to "12pm". As a test, I created an event from 12am to 12:30am and it was created as 12pm through 12:30pm.
The next test, I created an event that started at 12am and ended at 1am. It created an event with just a single start time of 12pm. Same thing happened when ending an event at 3am.
The last test, I created an event from 1am through 3am and it was created successfully.
For what it's worth.
Eric
Comment #4
salvisThank you for your debugging work, Eric.
2.x-dev is still work in progress -- well, actually, it's sorta stuck while killes decides
Once these questions are decided, Michelle's effort at http://drupal.org/node/147558 might get some new life and hopefully a decision in the end, and then your JS knowledge would be most appreciated to actually implement it. Until then...
Comment #5
ecarter commentedHi, thanks Salvis. Well I'd be happy to help out where I can. I thought I'd try using 2.x-dev because of the issues I read concerning the 12hr thing on 1.x.
I did figure though whole thing out.. spent the day learning about JQuery used within Drupal. That's pretty cool stuff. Once observation I made, that may be helpful to others:
It's not clear but I don't think there's an easy way using the forms builder (includes/form.inc) to specify individual css ID or classes using the "radios" type where you pass in an array of radio button options. Instead, you'll have to use the individual value of each radio button.
I think this is part of the struggle Michelle was having in another thread I read where the suggested course of action was to make "00" and "23" be the defaults in javascript. It doesn't work because the drop downs should only be 1-12 for the 12 hour system. You cannot select "00" or "23".. in 2x-dev the 00 is there, but the upper limit is 12. If that makes any sense..
So, I had to modify the following line first to take out "00" in the event.module file ~ line 1481:
then within event.module, I had to modify the following ~ line 2035:
Then, within event.module around line 3052 I had to add the following:
That's all I changed within the event module. Now, on to the contrib/event_all_day module..
I changed the logic so I had a separate javascript file for 12hr vs 24hr.
(Around line 24..)
Then, I just kept hacking away at JQuery until I could figure out how to select the radio buttons without using a css ID or class.
I just modified two of the functions related to figuring out the event all day.. the following function will determine if people select an "all day" event manually.
Than, I updated the function that automagically changes the input fields for start and end times.
It seems to work alright so far, I know it's kinda cobbled together. There may be a more elegant solution.
Thanks for pointing me to the UI discussion, I'll follow up there. I'm new to all of this, just started working with Drupal in June. However I'm excited about the community and the flexibility of the software.
All the best,
Eric
Comment #6
salvisHi Eric,
I hope that killes (the maintainer of the Event module) will find time to make the necessary decisions and to provide the guidance as to in which direction he wants Events to evolve. Until then your efforts will probably be in vain, so please save some breath.
The preferred way to submit proposed changes is described in http://drupal.org/patch/create and http://drupal.org/patch/submit, and following that recipe will increase your chances for catching killes' attention.
Thanks in advance!
Hans
Comment #7
Anonymous (not verified) commented(subscribing)
Comment #8
jtjones23 commentedsubscribing
Comment #9
Anonymous (not verified) commentedThere is a patch that does what you want (at least I think so) at http://drupal.org/node/199417
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.