It does not seem to have the ability to deal with "all day" events, am I missing something or is this so

Thanks

Joe

Comments

artatac’s picture

Any chance of some feedback on this request please?? I see the demo has such a feature http://upcoming.yahoo.com/event/add/

misterlawrence’s picture

I don't believe that Calendar has this functionality per se, though I have been able to get around that for my purposes by creating a date field that only has granularity to the day level (no hours, minutes, seconds). This works for me, but I would much rather have an "All Day" check box too!

I believe that the Event module has "All Day" functionality. I haven't played around with it much though.

karens’s picture

Project: Calendar » Date

This would be a Date module request.

karens’s picture

Status: Active » Fixed

'http://upcoming.yahoo.com/event/add/' is not a demo of this module, not sure where you got that idea. You can create dates without time granularity if you don't want time, or you can set the time to 00:00:00 to 23:59:59. You can intervene in the theme to check for dates with those times and display them as 'all day' instead of showing the time.

There is currently no checkbox for 'all day', but that could be a feature request.

Anonymous’s picture

Status: Fixed » Closed (fixed)
michelle’s picture

Category: support » feature
Status: Closed (fixed) » Active

"There is currently no checkbox for 'all day', but that could be a feature request."

I ran into this issue searching for just such a feature. When I chose the event module well over a year ago, this was the biggest reason. I need the option per node (not per field) to enter times or not and don't want to have to explain to non computer literate people that they need to type in 12:00am - 11:30pm. The Google calendar has a really nice UI and there is a simple "all day" checkbox there to remove the times. The event module's UI is part way to having this but killes doesn't know JS (and neither do I) and so it's been stuck in this half done state for the last year and I need to get something working on my site. So I came back to date.module to give the 2.x version another try and was disappointed that it still doesn't handle all day events. So here I am making the feature request. :)

Thanks,

Michelle

michelle’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev

Forgot to update the version.

Michelle

elvis2’s picture

Title: All day events » All Day (Date) module + patch suggestion
StatusFileSize
new1.36 KB

I have finished this feature request but requires a small patch. Below is the summary and proposed solution. Module is attached. Tested on Date 5.x-2.x-dev.

Summary
======================
date_popup.module,
function date_popup_process_time()

adds the cck field name ($element[#'id']) into the input field class and id. The All Day .js can't pickup the $element['#id'] from within the .js code, so a patch is required, which doesn't alter other functionality elsewhere in date and related modules.

Solution:
======================
In addition to the module you need the following patch to make All Day module work.

File: date_popup.module
Function: date_popup_process_time()

From this:

  $sub_element = array(
    '#type' => 'textfield',
    '#default_value' => is_object($date) ? date_format($date, $time_format) : '',
    '#attributes' => array('class' => 'jquery-timeentry-'. $element['#id']),
    '#size' => 10,
    '#maxlength' => 10,
    );

To this:


    if(module_exists('date_all_day')) {
      $all_day_text = ' all_day_';
    
      if($element['#parents'][2] == 'value') {
        $all_day_value = '1';
      }
      elseif($element['#parents'][2] == 'value2') {
        $all_day_value = '2';
      }
      
      $all_day_class = $all_day_text . $all_day_value;

    }

  $sub_element = array(
    '#type' => 'textfield',
    '#default_value' => is_object($date) ? date_format($date, $time_format) : '',
    '#attributes' => array('class' => 'jquery-timeentry-'. $element['#id'] . $all_day_class),
    '#size' => 10,
    '#maxlength' => 10,
    );

Thoughts?

karens’s picture

#8 looks interesting, except that I don't think this needs to be a separate module. I think it could be available on all dates that have a granularity that includes any time values (hour, minute, second). I'm getting ready to start a big bugfix fest on the D5.2 version this week, so I'll look at it soon.

michelle’s picture

Thanks, Karen. I'd really love to have this as part of the date module itself rather than something hacked into it on my site. As much as I hate to abandon killes, having this in date would clinch the move for me. The event module is nice but I just can't wait anymore for the UI to get fixed and it's not something I have the skills to step up and do for him. I already do everything else with CCK and views anyway, so I guess it's time to switch.

Michelle

elvis2’s picture

@KarenS, You are right, it does not need to be a separate module. I only suggested that because it is the same method the "event" module is using. I used the event_all_day module as a skeleton for this date_all_day module.

Yes, it would need to be granular, I noticed that might cause a problem for some setups when going over the js.

I look forward to seeing it added.

karens’s picture

@mcneelycorp - can you attach just the js code alone as a .txt file or the whole thing as a zip file? I'm having trouble untarring your file.

elvis2’s picture

StatusFileSize
new7 KB

@KarenS, sure. I now see there is a problem with the file. I originally tried to upload a zip file but I will try again.

kopo88’s picture

Subscribing. Will this get fixed in Calendar as well?

Mike Sances’s picture

I've tested this module + patch to date_popup and it works well. However, the checkbox doesn't do anything in Internet Explorer. Any ideas why not?

elvis2’s picture

@#15, sorry I do not know why offhand. Chances are it is because of the id or class, my guess. If this gets committed I will look into IE problems.

karens’s picture

Status: Active » Needs work

There are lots of changes that need to be made for this to work:

1) There is only one checkbox for the whole form, no matter how many date fields are on it. It needs to work if there are date fields with multiple values and if there is more than one different date field in the form. It seems to me there should be a separate checkbox for each individual date field. This will require changes both in the html that is created and in the js. It won't be easy to hook_form_alter the checkbox in, it probably needs to be added as a part of the regular hook_widget() processing so it can be injected into each date field. That means it will be easier to do this as a part of the regular date code rather than as a separate module.

2) There is an assumption that time is always 12 hour time that shows hours and minutes but no seconds, but it could be 24 hour time, could include seconds, or could exclude minutes. Plus it could be formatted differently than HH;MM, the date module allows any custom format, so someone could use HH.MM or HH MM or HH-MM or whatever. We store the right format for the date in the field settings, so we have to use ajax or some other method to find the right format for the time.

3) The default time is set to 5:59AM to 23:59PM. I assume that is a typo?

4) In the same way that the time format can be different, the form layout can be different, depending on what kind of a widget is used -- the select widget creates an array of date parts and the popup widget creates an array of date and time elements, and the text widget creates a single textfield. And the exact date parts that are included vary depending on the granularity of the field. The js has to work with all these possibilities.

4) Once this is all fixed, it needs to be tested in several browsers and environments.

Those issues need to be addressed before we have anything I can commit.

dugh’s picture

subscribing

karens’s picture

I did some more thinking about this and I think I have a way to make this easier, if someone with some jQuery skills can provide the code. I will wrap the time portion of each date field in a unique class, let's call it 'date_time_part'. I will also add an 'all day' checkbox to the code. I will do all the computation of what values need to go into 'time' if that checkbox is checked in my form validation, so nothing needs to be done with that in the jquery code.

That means the only thing the jquery code needs to do is look for the state of the checkbox and either hide or show the related 'date_time_part' element. Since there can be more than one, we'll probably have to add an id somewhere so you can tell which checkbox goes with which time part.

Anyone up for writing the jquery part of this? I can do the rest.

karens’s picture

The other side of getting this working right is to have 'All day' formatting of the results on the node display and in Views. I committed some changes today to add that part in.

kopo88’s picture

I might be overlooking something, but why would this require jQuery? It seems like we just need a few lines of basic Javascript to toggle the visibility of the date_time_part DIV (or other element) by ID, right? It's possible we might also have to disable the invisible form fields to prevent the user from tabbing into them, but I'd have to experiment to be sure.

karens’s picture

Drupal uses jQuery as the standard method of incorporating javascript. Mostly to avoid potential conflicts, but also for consistency and because Drupal developers should be familiar with it which will make maintenance easier.

It should be fairly simple either way, though. I know jQuery has a simple method of hiding/showing fields, I just don't have time to dig into it.

dugh’s picture

I just deleted the time when entering a date and it showed up as (all day) in the calendar.

So maybe an 'all day' checkbox can just blank out the time box (for the jscalendar popup input method).

Thanks for this feature. One person freaked out when this 3 day workshop earlier showed as starting at 12am the 2nd day.

OpenChimp’s picture

This feature would be GRRREAT! Like Cornflakes ;)

Just wanted to point out that this isn't always just for single day events. It would also be very useful for multi-day events like "Spring Break" on a school website. In these cases, it would obviously make sense for the administrator to be able to specify a start day and end day, but not have times specified because otherwise those times show up in the calendar and confuse the visitors. So ... it's still a single date entry with a start and stop time, and the "all day" checkbox should work fine, but I just wanted to point this out in case that effects anything in the code or interface that would be different than 1-day "all day" events.

karens’s picture

Title: All Day (Date) module + patch suggestion » Add 'all day' flag to dates
Version: 5.x-2.x-dev » 6.x-2.x-dev

Feature requests are going to the D6 version, to be backported if possible.

somebodysysop’s picture

So, is an "all day" flag now available in the date module? IF so, as of what version?

karens’s picture

Status: Needs work » Active

This is a feature request, and the original patch no longer applies. This would have to be written.

vito_a’s picture

Modified the Date All day module originally posted by mcneelycorp and tested it for 5.14. Planning to upgrade it to 6.x.

It also fixes the 'click on calendar to create event' issue related to the http://drupal.org/node/22741 and http://drupal.org/node/6922 now.

The module is at the Date all day module . I'll really appreciate any comments and suggestions, especially from the mcneelycorp , who did it originally.

flickerfly’s picture

Status: Active » Needs review
StatusFileSize
new2.79 KB

Vito_a, thanks for your work on this.

How goes the D6 port? I'd be glad to test that. I don't have a D5 testing environment setup anymore so am not willing to test D5. Are you looking to make this an entirely new module with a new project page and all or do you expect this to be another module that is just part of the bigger Date project?

I'm attaching the download to encourage exploration of this module by others and save them from having to click over to another site. I'm also marking it patch (code needs review) so it is know that something usable is here.

karens’s picture

Status: Needs review » Closed (duplicate)

As noted in #5, I don't think this really needs to be a separate module, I was planning to add this feature directly into the Date module. It's just adding an option and a checkbox and some js. I was just waiting for a patch. Someone is now working on another all day patch at #370092: All-day event support for ical with a D6 patch and some additional work to handle the all day dates better in the calendar. Since the other issue has a D6 patch and this one does not, I guess I'll consolidate this work on that issue.

@vito_a, I'm not clear what your intention is for this. You seem to be trying to create a separate module instead, and only for D5? It looks like you have some nice js that might be made to work in D6. I'm thinking we could incorporate it into the Date module for D6.

vito_a’s picture

StatusFileSize
new9.07 KB
new9.15 KB

@KarenS : Thank you, incorporating it into the Date module would be nice. No, certainly, I'm not trying to do no extra work, thank you for your great module. Just lack these functions in the Date module, so added these. Also integrated the ClockPick Timepicker plugin for jQuery by Josh Nathanson, v, 1.2.4 ( http://www.oakcitygraphics.com/jquery/clockpick/trunk/ClockPick.cfm ) for time fields, which is a nice and useful one IMHO.

@KarenS, @flickerfly: yes, just updated to D6, there are D5 and D6 versions now at my download page : http://vito.ho.ua/en/content/download , also attaching these here for your convenience, would appreciate any feedback concerning it and probably its integration into the Date module.

karens’s picture

Thanks vito_a. Note that Aron has posted a patch on the other link at #370092: All-day event support for ical and I'd like to consolidate this work to best advantage so maybe you could contribute some ideas there.

Integrating the timepicker would be a different issue, one that already exists #333702: New time picker perhaps?. I'm well aware that the current timepicker isn't great and am open to doing something different. But can you move the timepicker work to that issue? There's a suggestion for another timepicker there. Whatever one we use must have a GPL license or we can't include the code in cvs.

aron novak’s picture

I just tested the module and I found an issue:
It uses hard-wired date input format, it simply behaves strangely while using other date formats.

karens’s picture

Yes, I looked at it more and that definitely is a problem. Plus it is trying to alter the values of the time fields which won't work correctly for all the types of dates that might exist. So this code won't work.

I think Aron's patch is the right approach (adding a simple checkbox to the field and altering the value on submission if it is checked) and the only jQuery we need is something very simple to show/hide the time fields. There is no need to alter the time values since that will be done during submission if the 'all day' checkbox is checked.

So we'll switch back to the other issue and the other patch to move forward and make further updates there.

cletusalphonse’s picture

Subscribe

KoCo’s picture

Subscribe

gmclelland’s picture

subscribing

nicoloconte’s picture

Subscribe

redsky’s picture

subscribing

uufsm’s picture

subscribe

sylvie_n’s picture

subscribe

tony.herr’s picture

subscribe

michelle’s picture

People, please stop subscribing to a duplicate issue. This issue is dead and all you're going to get by subscribing is seeing all the people after you subscribe.

Michelle

sylvie_n’s picture

hi Michelle.
Please could you post a link to the duplicate issue.
many thanks

michelle’s picture

This is the duplicate issue. See the "Status" field? If you read #34, it's clear that there is no more work going on in this issue so all this "subscribing" is doing is bumping a dead issue in peoples' trackers.

Michelle

arlinsandbulte’s picture

sylvie_n: Look at post #30 above for the other issue...