Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.3.3, 3.4
-
Component/s: Calendar
-
Testing Instructions:
-
Affected Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Fixed Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-61027-master -
Pull Master Diff URL:
Description
- First I install persian calendar
- I add a custom profile field to get Date of birth of users
- In this case users can pick a date (solar date)
- when a user wants to save profile settings
- date changes automatically
- and saves a negative number for time in DB
But I found my answer . the profilefield_datetime plugin uses min and max date based on Gregorian calendar . I fixed my problem by convert to Gregorian date before processing date :
In profilefield_datetime and in field.class.php and in "edit_save_data_preprocess" method I replaced This line :
$datetime = userdate($datetime, '%Y-%m-%d-%H-%M-%S');
by
$datetime = date('Y-m-d-H-m-s', $datetime);