mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +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)) {
|
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);
|
$datetime = explode('-', $datetime);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue