Changeset - 2d41f5d80104
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 14 years ago 2012-02-07 20:35:21
ohnobinki@ohnopublishing.net
Add support for detecting the start and end times of a semester, which enables the correct semester to be automatically selected.
1 file changed with 18 insertions and 0 deletions:
0 comments (0 inline, 0 general)
school.d/umich.crawl.inc
Show inline comments
 
@@ -283,6 +283,24 @@ function umich_crawl_semester(array $sch
 
							$row_accumulation['Instructor']),
 
				     $meeting_type,
 
				     $credit_hours);
 

	
 
      /*
 
       * If the section so far passed as being a normal section, use
 
       * its start and end dates to help determine the semester's
 
       * respective start and end dates.
 
       */
 
      $date_start_tm = strptime(trim($row[$fields['Start Date']]), '%m/%d/%Y');
 
      $date_end_tm = strptime(trim($row[$fields['End Date']]), '%m/%d/%Y');
 
      if (!empty($date_start_tm) && !empty($date_end_tm))
 
	{
 
	  $date_start = school_crawl_gmmktime($date_start_tm);
 
	  $date_end = school_crawl_gmmktime($date_end_tm);
 
	  if ($date_start > 1000000 && $date_end > 1000000)
 
	    {
 
	      $semester->time_start_set_test($date_start);
 
	      $semester->time_end_set_test($date_end);
 
	    }
 
	}
 
    }
 
}
 

	
0 comments (0 inline, 0 general)