Skip to content

Commit

Permalink
MDL-61027 calendar: Fix datetime profile field issue with non-Gregorian
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Jan 22, 2018
1 parent c9236c6 commit ca40c1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion user/profile/field/datetime/field.class.php
Expand Up @@ -81,7 +81,8 @@ public function edit_save_data_preprocess($datetime, $datarecord) {
}

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);
Expand Down

0 comments on commit ca40c1f

Please sign in to comment.