$string['statuses'] = 'Statuses';
$string['statusdeleted'] = 'Status deleted';
$string['statusset'] = 'Status set {$a}';
-$string['strftimedm'] = '%d.%m';
-$string['strftimedmy'] = '%d.%m.%Y';
-$string['strftimedmyhm'] = '%d.%m.%Y %H.%M'; // Line added to allow multiple sessions in the same day.
-$string['strftimedmyw'] = '%d.%m.%y (%a)';
-$string['strftimehm'] = '%H:%M'; // Line added to allow display of time.
+$string['strftimedm'] = '%h %d';
+$string['strftimedmy'] = '%d %h %Y';
+$string['strftimedmyhm'] = '%d %h %Y %I.%M%P'; // Line added to allow multiple sessions in the same day.
+$string['strftimedmyw'] = '<nobr>%a %d %h %Y</nobr>';
+$string['strftimeh'] = '%l%P';
+$string['strftimehm'] = '%l:%M%P';
$string['strftimeshortdate'] = '%d.%m.%Y';
$string['studentid'] = 'Student ID';
$string['summary'] = 'Summary';
private function construct_take_session_info(attendance_take_data $takedata) {
$sess = $takedata->sessioninfo;
$date = userdate($sess->sessdate, get_string('strftimedate'));
- $starttime = userdate($sess->sessdate, get_string('strftimehm', 'attendance'));
- $endtime = userdate($sess->sessdate + $sess->duration, get_string('strftimehm', 'attendance'));
+ $starttime = attendance_strftimehm($sess->sessdate);
+ $endtime = attendance_strftimehm($sess->sessdate + $sess->duration);
$time = html_writer::tag('nobr', $starttime . ($sess->duration > 0 ? ' - ' . $endtime : ''));
$sessinfo = $date.' '.$time;
$sessinfo .= html_writer::empty_tag('br');
$options = array();
foreach ($takedata->sessions4copy as $sess) {
- $start = userdate($sess->sessdate, get_string('strftimehm', 'attendance'));
- $end = $sess->duration ? ' - '.userdate($sess->sessdate + $sess->duration,
- get_string('strftimehm', 'attendance')) : '';
+ $start = attendance_strftimehm($sess->sessdate);
+ $end = $sess->duration ? ' - '.attendance_strftimehm($sess->sessdate + $sess->duration) : '';
$options[$sess->id] = $start . $end;
}
$select = new single_select($takedata->url(array(), array('copyfrom')), 'copyfrom', $options);
foreach ($reportdata->sessions as $sess) {
$sesstext = userdate($sess->sessdate, get_string('strftimedm', 'attendance'));
$sesstext .= html_writer::empty_tag('br');
- $sesstext .= userdate($sess->sessdate, '('.get_string('strftimehm', 'attendance').')');
+ $sesstext .= attendance_strftimehm($sess->sessdate);
$capabilities = array(
'mod/attendance:takeattendances',
'mod/attendance:changeattendances'
}
}
+// Used to print simple time - 1am instead of 1:00am
+function attendance_strftimehm($time) {
+ $mins = userdate($time, '%M');
+ if ($mins == '00') {
+ return userdate($time, get_string('strftimeh', 'attendance'));
+ } else {
+ return userdate($time, get_string('strftimehm', 'attendance'));
+ }
+}
+
function construct_session_time($datetime, $duration) {
- $starttime = userdate($datetime, get_string('strftimehm', 'attendance'));
- $endtime = userdate($datetime + $duration, get_string('strftimehm', 'attendance'));
+ $starttime = attendance_strftimehm($datetime);
+ $endtime = attendance_strftimehm($datetime + $duration);
return $starttime . ($duration > 0 ? ' - ' . $endtime : '');
}
// Set a title as the date and time of the session.
$sesstiontitle = userdate($attforsession->sessdate, get_string('strftimedate')).' '
- .userdate($attforsession->sessdate, get_string('strftimehm', 'mod_attendance'));
+ .attendance_strftimehm($attforsession->sessdate);
$mform->addElement('header', 'session', $sesstiontitle);