mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
Merge branch 'MDL-76470-master' of https://github.com/marinaglancy/moodle
This commit is contained in:
commit
b38e0e9db4
@ -708,6 +708,13 @@ class core_date {
|
||||
* @author BohwaZ <https://bohwaz.net/>
|
||||
*/
|
||||
public static function strftime(string $format, $timestamp = null, ?string $locale = null) : string {
|
||||
// Moodle-specific modification. For the IntlDateFormatter we need to use unix-style locale
|
||||
// from the string 'locale' even for Windows, so we can neither use moodle_getlocale().
|
||||
// nor rely on the setlocale() use below. We also ignore $CFG->locale because it can use
|
||||
// Windows format.
|
||||
$locale = $locale ?: get_string('locale', 'langconfig');
|
||||
|
||||
// The following code is taken from https://github.com/alphp/strftime without modifications.
|
||||
// phpcs:disable
|
||||
if (!($timestamp instanceof DateTimeInterface)) {
|
||||
$timestamp = is_int($timestamp) ? '@' . $timestamp : (string) $timestamp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user