mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-61027 calendar: Fix datetime profile field issue with non-Gregorian
This commit is contained in:
parent
f68150ad05
commit
425817793a
1 changed files with 2 additions and 1 deletions
|
@ -81,7 +81,8 @@ class profile_field_datetime extends profile_field_base {
|
|||
}
|
||||
|
||||
if (is_numeric($datetime)) {
|
||||
$datetime = userdate($datetime, '%Y-%m-%d-%H-%M-%S');
|
||||
$gregoriancalendar = \core_calendar\type_factory::get_calendar_instance('gregorian');
|
||||
$datetime = $gregoriancalendar->timestamp_to_date_string($datetime, '%Y-%m-%d-%H-%M-%S', 99, true, true);
|
||||
}
|
||||
|
||||
$datetime = explode('-', $datetime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue