Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
1ac7ee24
Commit
1ac7ee24
authored
Mar 10, 2005
by
moodler
Browse files
CFG->nofixday can override the ficing of day format in userdate
parent
27bf9e20
Changes
2
Hide whitespace changes
Inline
Side-by-side
config-dist.php
View file @
1ac7ee24
...
...
@@ -199,6 +199,10 @@ $CFG->admin = 'admin';
// settings. Use this if you want to control session configuration
// from php.ini, httpd.conf or .htaccess files.
// $CFG->respectsessionsettings = true;
//
// This setting will cause the userdate() function not to fix %d in
// date strings, and just let them show with a zero prefix.
// $CFG->nofixday = true;
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
...
...
lib/moodlelib.php
View file @
1ac7ee24
...
...
@@ -691,13 +691,19 @@ function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0,
*/
function
userdate
(
$date
,
$format
=
''
,
$timezone
=
99
,
$fixday
=
true
)
{
global
$CFG
;
static
$strftimedaydatetime
;
if
(
$format
==
''
)
{
$format
=
get_string
(
'strftimedaydatetime'
);
if
(
empty
(
$strftimedaydatetime
))
{
$strftimedaydatetime
=
get_string
(
'strftimedaydatetime'
);
}
$format
=
$strftimedaydatetime
;
}
$formatnoday
=
str_replace
(
'%d'
,
'DD'
,
$format
);
if
(
$fixday
)
{
if
(
$fixday
and
empty
(
$CFG
->
nofixday
))
{
// Config.php can force %d not to be fixed.
$fixday
=
(
$formatnoday
!=
$format
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment