Activity log for bug #1982702

Date Who What changed Old value New value Message
2022-07-24 23:29:41 Robert Lyon bug added bug
2022-07-24 23:29:46 Robert Lyon mahara: status New Confirmed
2022-07-24 23:29:47 Robert Lyon mahara: importance Undecided High
2022-07-24 23:29:50 Robert Lyon mahara: milestone 22.10.0
2022-07-25 00:02:08 Robert Lyon description Display the dates in correct language If we have a multi tenancy site then the PHP language may not be set to the one a person is viewing the site with so that PHP created strings, like a date may be in wrong language, eg EN 24 July 2022, 08:37 DE 24. July 2022, 08:37 We can't use the PHP setlocale() function because it can cause issues on a multithreaded server Now that we are including PHP intl module by default we can use some of it's functions to get what we need, eg: $cl = current_language(); // Remove the '.utf8' from the language $cl = preg_replace('/\.utf8$/','',$cl); $langobject = datefmt_create($cl, IntlDateFormatter::LONG, IntlDateFormatter::SHORT); $langstring = datefmt_format($langobject, 1658651838); log_debug($langstring); Display the dates in correct language If we have a multi tenancy site then the PHP language may not be set to the one a person is viewing the site with so that PHP created strings, like a date may be in wrong language, eg EN 24 July 2022, 08:37 DE 24. July 2022, 08:37 We can't use the PHP setlocale() function because it can cause issues on a multithreaded server Now that we are including PHP intl module by default we can use some of it's functions to get what we need, eg:     $cl = current_language();     // Remove the '.utf8' from the language     $cl = preg_replace('/\.utf8$/','',$cl);     $langobject = $te($cl, IntlDateFormatter::LONG, IntlDateFormatter::SHORT, null, null, 'dd. MMMM yyyy, hh:HH');     $langstring = datefmt_format($langobject, 1658651838);     log_debug($langstring);
2022-08-15 02:54:43 Kristina Hoeppner tags bite-sized
2022-09-05 04:05:50 Robert Lyon description Display the dates in correct language If we have a multi tenancy site then the PHP language may not be set to the one a person is viewing the site with so that PHP created strings, like a date may be in wrong language, eg EN 24 July 2022, 08:37 DE 24. July 2022, 08:37 We can't use the PHP setlocale() function because it can cause issues on a multithreaded server Now that we are including PHP intl module by default we can use some of it's functions to get what we need, eg:     $cl = current_language();     // Remove the '.utf8' from the language     $cl = preg_replace('/\.utf8$/','',$cl);     $langobject = $te($cl, IntlDateFormatter::LONG, IntlDateFormatter::SHORT, null, null, 'dd. MMMM yyyy, hh:HH');     $langstring = datefmt_format($langobject, 1658651838);     log_debug($langstring); Display the dates in correct language If we have a multi tenancy site then the PHP language may not be set to the one a person is viewing the site with so that PHP created strings, like a date may be in wrong language, eg EN 24 July 2022, 08:37 DE 24. July 2022, 08:37 We can't use the PHP setlocale() function because it can cause issues on a multithreaded server Now that we are including PHP intl module by default we can use some of it's functions to get what we need, eg:     $cl = current_language();     // Remove the '.utf8' from the language     $cl = preg_replace('/\.utf8$/','',$cl);     $langobject = datefmt_create($cl, IntlDateFormatter::LONG, IntlDateFormatter::SHORT, null, null, 'dd. MMMM yyyy, hh:HH');     $langstring = datefmt_format($langobject, 1658651838);     log_debug($langstring);
2022-09-27 22:37:40 Kristina Hoeppner mahara: milestone 22.10.0 23.04.0
2023-03-28 00:13:54 Kristina Hoeppner mahara: milestone 23.04.0 24.04.0
2023-07-11 04:56:06 Doris Tam mahara: assignee Doris Tam (doristam)
2023-07-11 04:56:09 Doris Tam mahara: status Confirmed In Progress
2023-07-11 04:56:14 Doris Tam bug watch added https://git.mahara.org/catalyst/mahara/-/issues/89