Log selector doesn't show dates

Log selector doesn't show dates

by Thomas Robb -
Number of replies: 2
I had been having trouble with the date selector not showing the entire range of dates. It was only showing today and "all". Looking at the code, I realized what the problem was. I have the course set to start on September 1, and when the date range is generated, it tests for whether the current date is greater than the start date:

(in moodle/course/lib.php)
 while ($timemidnight > $course->startdate and $numdates < 365)

I had to set the startdate on 1 September since that is when the official coursework begins and the dates on the "weekly format" need to reflect that, but for two weeks prior to that I have been getting the students to sign up, upload their pictures and give their introductions. I thus would like the log to work "properly" even before the course begins.

This code exists just for cases when the startdate hasn't been established:

if (! $course->startdate) {
  $course->startdate = $course->timecreated;
}

Could this condition also be added for cases such as mine?
if (! $course->startdate < $today) {
  $course->startdate = $course->timecreated;
}

--Tom
Average of ratings: -
In reply to Thomas Robb

Re: Log selector doesn't show dates

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Done:

if (!$course->startdate or ($course->startdate > $timenow)) {
    $course->startdate = $course->timecreated;
}