Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 15... Línea 15...
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
namespace core_calendar\external;
17
namespace core_calendar\external;
-
 
18
 
18
 
19
use core\external\exporter;
19
use core\external\exporter;
20
use core_calendar\output\humantimeperiod;
20
use core_date;
21
use core_date;
21
use DateTimeImmutable;
22
use DateTimeImmutable;
22
use renderer_base;
23
use renderer_base;
Línea 159... Línea 160...
159
            $data = $exporter->export($output);
160
            $data = $exporter->export($output);
Línea 160... Línea 161...
160
 
161
 
161
            // We need to override default formatted time because it differs from day view.
162
            // We need to override default formatted time because it differs from day view.
162
            // Formatted time for day view adds a link to the day view.
163
            // Formatted time for day view adds a link to the day view.
-
 
164
            $legacyevent = container::get_event_mapper()->from_event_to_legacy_event($event);
-
 
165
            $humanperiod = humantimeperiod::create_from_timestamp(
-
 
166
                starttimestamp: $legacyevent->timestart,
-
 
167
                endtimestamp: $legacyevent->timestart + $legacyevent->timeduration,
-
 
168
                link: new moodle_url(CALENDAR_URL . 'view.php'),
163
            $legacyevent = container::get_event_mapper()->from_event_to_legacy_event($event);
169
            );
Línea 164... Línea 170...
164
            $data->formattedtime = calendar_format_event_time($legacyevent, time(), null);
170
            $data->formattedtime = $output->render($humanperiod);
165
 
171
 
Línea 166... Línea 172...
166
            return $data;
172
            return $data;