Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d80140b4
Commit
d80140b4
authored
Sep 29, 2003
by
Dries
Browse files
- Made sure dates can be translated nicely. Patch by Gobar.
parent
9a0573a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
d80140b4
...
...
@@ -907,29 +907,29 @@ function format_date($timestamp, $type = "medium", $format = "") {
switch
(
$type
)
{
case
"small"
:
$date
=
date
(
variable_get
(
"date_format_short"
,
"m/d/Y - H:i"
),
$timestamp
);
break
;
case
"medium"
:
$date
=
date
(
variable_get
(
"date_format_medium"
,
"D, m/d/Y - H:i"
),
$timestamp
);
$format
=
variable_get
(
"date_format_short"
,
"m/d/Y - H:i"
);
break
;
case
"large"
:
$
d
at
e
=
date
(
variable_get
(
"date_format_long"
,
"l, F j, Y - H:i"
)
,
$timestamp
)
;
$
form
at
=
variable_get
(
"date_format_long"
,
"l, F j, Y - H:i"
);
break
;
case
"custom"
:
for
(
$i
=
strlen
(
$format
);
$i
>=
0
;
$c
=
$format
[
--
$i
])
{
if
(
strstr
(
"DFlMSw"
,
$c
))
{
$date
=
t
(
date
(
$c
,
$timestamp
))
.
$date
;
}
else
if
(
strstr
(
"AaBdgGhHiIjLmnOrstTUWYyZz"
,
$c
))
{
$date
=
date
(
$c
,
$timestamp
)
.
$date
;
}
else
{
$date
=
$c
.
$date
;
}
}
// No change to format
break
;
case
"medium"
:
default
:
$date
=
date
(
variable_get
(
"date_format_medium"
,
"l, m/d/Y - H:i"
),
$timestamp
);
$format
=
variable_get
(
"date_format_medium"
,
"D, m/d/Y - H:i"
);
}
for
(
$i
=
strlen
(
$format
);
$i
>=
0
;
$c
=
$format
[
--
$i
])
{
if
(
strstr
(
"DFlMSw"
,
$c
))
{
$date
=
t
(
date
(
$c
,
$timestamp
))
.
$date
;
}
else
if
(
strstr
(
"AaBdgGhHiIjLmnOrstTUWYyZz"
,
$c
))
{
$date
=
date
(
$c
,
$timestamp
)
.
$date
;
}
else
{
$date
=
$c
.
$date
;
}
}
return
$date
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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