When using ajax you can't see events for previous months although the days are showing. See this issue: #1279588: Load additional events when using ajax So it would be nice if there was an option to hide the days for the previous/next month from displaying so it doesn't confuse anyone.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

redndahead’s picture

Status: Active » Needs review
FileSize
2.24 KB

Here is the patch

redndahead’s picture

Couple of comments on this patch

1) Variable/class names can easily change. I wasn't sure what to call them.
2) I had to wrap the form element in a div and clear:both; to make it look right. This doesn't seem like the best option is there something else I can do to move it to the next line?

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/includes/fullcalendar.fullcalendar.incundefined
@@ -79,6 +79,7 @@ function fullcalendar_fullcalendar_option_definition() {
+    'displayAllDays' => array('default' => 1),

should be

'default' => TRUE,
'bool' => TRUE,
+++ b/includes/fullcalendar.fullcalendar.incundefined
@@ -226,6 +227,16 @@ function fullcalendar_fullcalendar_options_form(&$form, &$form_state, &$view) {
+    '#prefix' => '<div style="clear: both;">',
+    '#suffix' => '</div>',

Is this really necessary?

+++ b/theme/theme.incundefined
@@ -36,6 +36,10 @@ function template_preprocess_fullcalendar(&$variables) {
+  if (!$variables['options']['displayAllDays']) {

Use !empty().

In general, we're using camelCase for options defined by the plugin itself, our custom options should be not_camel_case.

redndahead’s picture

Status: Needs work » Needs review
FileSize
2.3 KB

Here are the fixes.

redndahead’s picture

FileSize
2.3 KB

White space removal

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/theme/theme.incundefined
@@ -36,6 +36,10 @@ function template_preprocess_fullcalendar(&$variables) {
+  if (!empty($variables['options']['display_all_days'])) {
+    $variables['element']['fullcalendar']['#attributes']['class'][] = 'fullcalendar-hide-other-month';

This should be in fullcalendar_fullcalendar_options_process() which is in includes/fullcalendar.fullcalendar.inc

redndahead’s picture

Status: Needs work » Needs review
FileSize
2.29 KB

Here you go.

redndahead’s picture

FileSize
2.29 KB

Good call on making sure I tested ;) There was a bug, I should have been using empty() instead of !empty()

redndahead’s picture

FileSize
2.34 KB

After some more irc discussions. Using display: none caused some height issues. So we now make the text go far far away.

redndahead’s picture

FileSize
2.4 KB

Now in the fullcalendar_options module. I still need to test. But a code review will help.

tim.plunkett’s picture

Having it be "uncheck" to disable doesn't work unless we write more upgrade path code, since it will register as unchecked until the view is resaved.
So this switches it to "Check to disable".

Note, if you've installed FullCalendar Options before, you have to go to admin/config/user-interface/fullcalendar/options and check that checkbox. Writing a hook_update_N for this is probably a waste of time.

The real problem here, is that while a negative text-indent hides the number, but does not hide the events. Display:none messes things up in other ways.

Reading through http://code.google.com/p/fullcalendar/issues/detail?id=166, it seems like this can only be truly fixed in the plugin.

tim.plunkett’s picture

I think instead of exposing this, we should just add it as the default behavior for ajax-based views until #1279588: Load additional events when using ajax is fixed. Thoughts?

tim.plunkett’s picture

redndahead’s picture

Status: Needs review » Reviewed & tested by the community

Tested this with ajax on and off. It works as advertised. Thanks Tim

redndahead’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

#1279588: Load additional events when using ajax will take care of the need for this patch. Marking as won't fix.