public function get_date_options() {
        global $SITE;

        $strftimedate = get_string("strftimedate");
        $strftimedaydate = get_string("strftimedaydate");

        // Get all the possible dates.
        // Note that we are keeping track of real (GMT) time and user time.
        // User time is only used in displays - all calcs and passing is GMT.
        $timenow = time(); // GMT.

        // What day is it now for the user, and when is midnight that day (in GMT).
        $timemidnight = usergetmidnight($timenow);

        // Put today up the top of the list.
        $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );

        // If course is empty, get it from frontpage.
        $course = $SITE;
        if (!empty($this->course)) {
            $course = $this->course;
        }
        if (!$course->startdate or ($course->startdate > $timenow)) {
            $course->startdate = $course->timecreated;
        }

        $numdates = 1;
        while ($timemidnight > $course->startdate and $numdates < 365) {
            $timemidnight = $timemidnight - 86400;
            $timenow = $timenow - 86400;
            $dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
            $numdates++;
        }
        return $dates;
    }
public function get_date_options() {
        global $SITE;

        $strftimedate = get_string("strftimedate");
        $strftimedaydate = get_string("strftimedaydate");

        // Get all the possible dates.
        // Note that we are keeping track of real (GMT) time and user time.
        // User time is only used in displays - all calcs and passing is GMT.
        $timenow = time(); // GMT.

        // What day is it now for the user, and when is midnight that day (in GMT).
        $timemidnight = usergetmidnight($timenow);

        // Put today up the top of the list.
        $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );

        // If course is empty, get it from frontpage.
        $course = $SITE;
        if (!empty($this->course)) {
            $course = $this->course;
        }
        if (!$course->startdate or ($course->startdate > $timenow)) {
            $course->startdate = $course->timecreated;
        }

        $numdates = 1;
        while ($timemidnight > $course->startdate and $numdates < 365) {
            $timemidnight = $timemidnight - 86400;
            $timenow = $timenow - 86400;
            $dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
            $numdates++;
        }
        return $dates;
    }
public function get_date_options ( ) { global $ SITE ; $ strftimedate = get_string ( "strftimedate" ) ; $ strftimedaydate = get_string ( "strftimedaydate" ) ; // Get all the possible dates. // Note that we are keeping track of real (GMT) time and user time. // User time is only used in displays - all calcs and passing is GMT. $ timenow = time ( ) ; // GMT. // What day is it now for the user, and when is midnight that day (in GMT). $ timemidnight = usergetmidnight ( $ timenow ) ; // Put today up the top of the list. $ dates = array ( "$timemidnight" => get_string ( "today" ) . ", " . userdate ( $ timenow , $ strftimedate ) ) ; // If course is empty, get it from frontpage. $ course = $ SITE ; if ( ! empty ( $ this -> course ) ) { $ course = $ this -> course ; } if ( ! $ course -> startdate or ( $ course -> startdate > $ timenow ) ) { $ course -> startdate = $ course -> timecreated ; } $ numdates = 1 ; while ( $ timemidnight > $ course -> startdate and $ numdates < 365 ) { $ timemidnight = $ timemidnight - 86400 ; $ timenow = $ timenow - 86400 ; $ dates [ "$timemidnight" ] = userdate ( $ timenow , $ strftimedaydate ) ; $ numdates ++ ; } return $ dates ; }
Return list of date options.

@return array date options.
Return list of date options .