mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 00:02:18 +02:00
Merge branch 'MDL-74379_master' of https://github.com/aya-saad1/moodle
This commit is contained in:
@@ -2356,6 +2356,21 @@ function date_format_string($date, $format, $tz = 99) {
|
||||
}
|
||||
|
||||
date_default_timezone_set(core_date::get_user_timezone($tz));
|
||||
|
||||
$datearray = getdate($date);
|
||||
|
||||
if (nl_langinfo(AM_STR) == nl_langinfo(PM_STR)) {
|
||||
|
||||
$format = str_replace([
|
||||
'%P',
|
||||
'%p',
|
||||
], [
|
||||
$datearray['hours'] < 12 ? get_string('am', 'langconfig') : get_string('pm', 'langconfig'),
|
||||
$datearray['hours'] < 12 ? get_string('amcaps', 'langconfig') : get_string('pmcaps', 'langconfig'),
|
||||
],
|
||||
$format);
|
||||
}
|
||||
|
||||
$datestring = strftime($format, $date);
|
||||
core_date::set_default_server_timezone();
|
||||
|
||||
|
Reference in New Issue
Block a user