catalyst / moodle-mod_reengagement

Allows timed release of content and emails users to remind them to complete a course activity
23 stars 39 forks source link

Completion time at 01/01/1970 #124

Closed GabGuev closed 1 year ago

GabGuev commented 1 year ago

Hello, In the database the completiontime empty is at 0, the code considers it like a timestamp so when it formats it, it gives 1/01/1970

image

It this line that poses a problem: https://github.com/catalyst/moodle-mod_reengagement/blob/34355e5235688ca839ec907abf0d540994cf74a1/classes/table/reengagement_participants.php#L423

I propose this correction : return $data->completiontime ? userdate($data->completiontime, get_string('strftimedatetimeshort', 'langconfig')) : '-';

For have that instead: image

Thanks 😃

danmarsden commented 1 year ago

thanks for the report, feel free to submit a pull request with that change otherwise it may sit here for a while.

danmarsden commented 1 year ago

thanks for the PR! - flagging this as closed.

GabGuev commented 1 year ago

Thanks @danmarsden! I'm glad to have contributed :)