danmarsden / moodle-mod_dialogue

Dialogue Module for Moodle
27 stars 35 forks source link

Dates not respecting local date format #97

Closed dinism closed 3 years ago

dinism commented 3 years ago

I'm in PORTUGAL and dates showed are not in the same format of my system (without pm or am) imagem

danmarsden commented 3 years ago

Thanks for the report! - I suspect this is coming from this line of code: https://github.com/danmarsden/moodle-mod_dialogue/blob/9b53c56d18e041b07a7762548ea14225cc77c875/locallib.php#L454

probably needs to use an strtotime string from the lang pack instead of the hard-coded values in there.

danmarsden commented 3 years ago

Hi @dinism - I've just pushed a fix for this into the github repository - feel free to download it directly from github and let me know if it has fixed this for you - thanks.

dinism commented 3 years ago

After the fix, time is OK but dates are in ENGLISH (not in portuguese, in our case) imagem

danmarsden commented 3 years ago

I'm 90% sure that this is your issue: https://docs.moodle.org/en/Calendar_FAQ#Why_are_month_names_not_being_displayed_in_the_correct_language.3F

That's an issue with the way Moodle uses dates - not something we can fix in Dialogue but something you will need to address on your webserver by setting the right locale.

thanks,

dinism commented 3 years ago

OK. Thanks for the reply. Before the update the months name were ok. In others plugins dates and time are ok. I installed other language packs and the result is the same: imagem In attendance plugin the name of the months name are ok. imagem Once again, thanks for the plugin.

danmarsden commented 3 years ago

thanks - the code that displays dates hasn't changed in at least 3 years - possibly even more - so maybe you just didn't notice this previously, or were using a very old version of dialogue, or in the process of upgrading your Server O/S you didn't set the correct locale.

I do think this is probably fixable in dialogue by rewriting the date handling a bit more but I can't see myself having time as a volunteer to do this - if you have internal development capabilities feel free to submit a Pull request for me to review. Alternatively setting the server locale will also hopefully fix it for you.