「全部點名紀錄列表」修正時間顯示問題 (整點顯示變12小時制+上午、下午)

JDP 2018-11-6 515

應該要顯示這樣「15:50 - 17:00」,但是mod_attendance的開發人員不知為何特別要寫一個副程式將整點的時間變成「5下午」,顯示就變成「15:50 - 5下午」

修改 /mod/attendance/locallib.php

原始

/**
 * Used to print simple time - 1am instead of 1:00am.
 *
 * @param int $time - unix timestamp.
 */
function attendance_strftimehm($time) {
    $mins = userdate($time, '%M');

    if ($mins == '00') {
        $format = get_string('strftimeh', 'attendance');
    } else {
        $format = get_string('strftimehm', 'attendance');
    }
...
}

修改為

/**
 * Used to print simple time - 1am instead of 1:00am.
 *
 * @param int $time - unix timestamp.
 */
function attendance_strftimehm($time) {
    $mins = userdate($time, '%M');

    $format = get_string('strftimehm', 'attendance');
...
}


最新回復 (0)
返回
發新帖