mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 18:04:43 +02:00
MDL-60742 calendar: allow customisation of 12/24h time format strings
This commit is contained in:
parent
3fa531ea2c
commit
099bca6de6
@ -1819,6 +1819,13 @@ function calendar_time_representation($time) {
|
||||
$timeformat = get_config(null, 'calendar_site_timeformat');
|
||||
}
|
||||
|
||||
// Allow language customization of selected time format.
|
||||
if ($timeformat === CALENDAR_TF_12) {
|
||||
$timeformat = get_string('strftimetime12', 'langconfig');
|
||||
} else if ($timeformat === CALENDAR_TF_24) {
|
||||
$timeformat = get_string('strftimetime24', 'langconfig');
|
||||
}
|
||||
|
||||
return userdate($time, empty($timeformat) ? $langtimeformat : $timeformat);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,8 @@ $string['strftimemonthyear'] = '%B %Y';
|
||||
$string['strftimerecent'] = '%d %b, %H:%M';
|
||||
$string['strftimerecentfull'] = '%a, %d %b %Y, %I:%M %p';
|
||||
$string['strftimetime'] = '%I:%M %p';
|
||||
$string['strftimetime12'] = '%I:%M %p';
|
||||
$string['strftimetime24'] = '%H:%M';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thisdirectionvertical'] = 'btt';
|
||||
$string['thislanguage'] = 'English';
|
||||
|
Loading…
x
Reference in New Issue
Block a user