Index: context.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context.module,v
retrieving revision 1.6.2.6.2.6
diff -u -p -r1.6.2.6.2.6 context.module
--- context.module	24 Jul 2009 01:27:05 -0000	1.6.2.6.2.6
+++ context.module	29 Nov 2009 21:38:09 -0000
@@ -403,10 +403,29 @@ function context_enabled_contexts($names
       foreach ($contexts as $context) {
         if (context_status($context) == CONTEXT_STATUS_ENABLED) {
           $identifier = "{$context->namespace}-{$context->attribute}-{$context->value}";
-          $enabled[$identifier] = $context;
+          $keep = TRUE;
+          // Allow for contexts to be enabled/disabled via date selection.
+          if (module_exists('date_api')) {
+            if (!empty($context->date_from)) {
+              // If the requested date is in the future, ignore this context.
+              if (time() < strtotime($context->date_from)) {
+                $keep = FALSE;
+              }
+            }
+            if (!empty($context->date_to)) {
+              // If the requested date is in the past, ignore this context.
+              if (time() > strtotime($context->date_to)) {
+                $keep = FALSE;
+              }
+            }
+          }
+          // Only enable this context if it has not been set to be ignored.
+          if ($keep) {
+            $enabled[$identifier] = $context;
+          }
+          unset($keep);
         }
       }
-
       // Set the cache
       context_cache_set('enabled', $enabled);
     }
Index: context_contrib/context_contrib.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context_contrib/Attic/context_contrib.module,v
retrieving revision 1.1.2.2.2.2
diff -u -p -r1.1.2.2.2.2 context_contrib.module
--- context_contrib/context_contrib.module	24 Jul 2009 01:12:02 -0000	1.1.2.2.2.2
+++ context_contrib/context_contrib.module	29 Nov 2009 21:38:09 -0000
@@ -32,6 +32,22 @@ function context_contrib_context_conditi
     );
   }
 
+  // Date
+  if (module_exists('date')) {
+    $items['date_from'] = array(
+      '#type' => 'date_select',
+      '#title' => t('From Date/Time'),
+      '#description' => t('The date and time this context should be active from. Please note that all fields must be selected in order for this to work.'),
+      '#date_year_range' => '0:+3',
+    );
+    $items['date_to'] = array(
+      '#type' => 'date_select',
+      '#title' => t('To Date/Time'),
+      '#description' => t('The date and time this context should be active until. Please note that all fields must be selected in order for this to work.'),
+      '#date_year_range' => '0:+3',
+    );
+  }
+
   return $items;
 }
 
