mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'wip-mdl-42537' of https://github.com/rajeshtaneja/moodle
Conflicts: lib/upgrade.txt
This commit is contained in:
commit
28cc8d4b43
5 changed files with 37 additions and 2 deletions
|
@ -210,4 +210,11 @@ abstract class type_base {
|
||||||
* @return array the converted date
|
* @return array the converted date
|
||||||
*/
|
*/
|
||||||
public abstract function convert_from_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
public abstract function convert_from_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This return locale for windows os.
|
||||||
|
*
|
||||||
|
* @return string locale
|
||||||
|
*/
|
||||||
|
public abstract function locale_win_charset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,4 +305,13 @@ class structure extends type_base {
|
||||||
'hour' => (int) $hour,
|
'hour' => (int) $hour,
|
||||||
'minute' => (int) $minute);
|
'minute' => (int) $minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This return locale for windows os.
|
||||||
|
*
|
||||||
|
* @return string locale
|
||||||
|
*/
|
||||||
|
public function locale_win_charset() {
|
||||||
|
return get_string('localewincharset', 'langconfig');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,4 +418,13 @@ class structure extends type_base {
|
||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This return locale for windows os.
|
||||||
|
*
|
||||||
|
* @return string locale
|
||||||
|
*/
|
||||||
|
public function locale_win_charset() {
|
||||||
|
return get_string('localewincharset', 'langconfig');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2187,8 +2187,16 @@ function userdate($date, $format = '', $timezone = 99, $fixday = true, $fixhour
|
||||||
*/
|
*/
|
||||||
function date_format_string($date, $format, $tz = 99) {
|
function date_format_string($date, $format, $tz = 99) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
|
$localewincharset = null;
|
||||||
|
// Get the calendar type user is using.
|
||||||
|
if ($CFG->ostype == 'WINDOWS') {
|
||||||
|
$calendartype = \core_calendar\type_factory::get_calendar_instance();
|
||||||
|
$localewincharset = $calendartype->locale_win_charset();
|
||||||
|
}
|
||||||
|
|
||||||
if (abs($tz) > 13) {
|
if (abs($tz) > 13) {
|
||||||
if ($CFG->ostype == 'WINDOWS' and $localewincharset = get_string('localewincharset', 'langconfig')) {
|
if ($localewincharset) {
|
||||||
$format = core_text::convert($format, 'utf-8', $localewincharset);
|
$format = core_text::convert($format, 'utf-8', $localewincharset);
|
||||||
$datestring = strftime($format, $date);
|
$datestring = strftime($format, $date);
|
||||||
$datestring = core_text::convert($datestring, $localewincharset, 'utf-8');
|
$datestring = core_text::convert($datestring, $localewincharset, 'utf-8');
|
||||||
|
@ -2196,7 +2204,7 @@ function date_format_string($date, $format, $tz = 99) {
|
||||||
$datestring = strftime($format, $date);
|
$datestring = strftime($format, $date);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($CFG->ostype == 'WINDOWS' and $localewincharset = get_string('localewincharset', 'langconfig')) {
|
if ($localewincharset) {
|
||||||
$format = core_text::convert($format, 'utf-8', $localewincharset);
|
$format = core_text::convert($format, 'utf-8', $localewincharset);
|
||||||
$datestring = gmstrftime($format, $date);
|
$datestring = gmstrftime($format, $date);
|
||||||
$datestring = core_text::convert($datestring, $localewincharset, 'utf-8');
|
$datestring = core_text::convert($datestring, $localewincharset, 'utf-8');
|
||||||
|
|
|
@ -54,6 +54,8 @@ information provided here is intended especially for developers.
|
||||||
dialogue.
|
dialogue.
|
||||||
* $CFG->filelifetime is now used consistently for most file serving operations, the default was lowered
|
* $CFG->filelifetime is now used consistently for most file serving operations, the default was lowered
|
||||||
to 6 hours from 24 hours because etags and x-sendfile support should make file serving less expensive.
|
to 6 hours from 24 hours because etags and x-sendfile support should make file serving less expensive.
|
||||||
|
* Date format locale charset for windows server will come from calendar type and for gregorian it will use
|
||||||
|
lang file.
|
||||||
|
|
||||||
DEPRECATIONS:
|
DEPRECATIONS:
|
||||||
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices
|
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue