MDL-61027 calendar: Fix datetime profile field issue with non-Gregorian

This commit is contained in:
Shamim Rezaie 2018-01-22 18:47:06 +11:00
parent f68150ad05
commit 425817793a

View file

@ -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);