Commit 881231ef authored by Penny Leach's avatar Penny Leach
Browse files

added language strings to langconfig for date formats, added format_date

function
parent ab0bd67b
...@@ -27,17 +27,17 @@ ...@@ -27,17 +27,17 @@
defined('INTERNAL') || die(); defined('INTERNAL') || die();
$string['parentlanguage'] = ''; $string['parentlanguage'] = '';
$string['strftimedate'] = ''; $string['strftimedate'] = '%%d %%B %%Y';
$string['strftimedateshort'] = ''; $string['strftimedateshort'] = '%%d %%B';
$string['strftimedatetime'] = ''; $string['strftimedatetime'] = '%%d %%B %%Y, %%I:%%M %%p';
$string['strftimedaydate'] = '', $string['strftimedaydate'] = '%%A, %%d %%B %%Y';
$string['strftimedaydatetime'] = ''; $string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = ''; $string['strftimedayshort'] = '%%A, %%d %%B';
$string['strftimedaytime'] = ''; $string['strftimedaytime'] = '%%a, %%H:%%M';
$string['strftimemonthyear'] = ''; $string['strftimemonthyear'] = '%%B %%Y';
$string['strftimerecent'] = ''; $string['strftimerecent'] = '%%d %%b, %%H:%%M';
$string['strftimerecentfull'] = ''; $string['strftimerecentfull'] = '%%a, %%d %%b %%Y, %%I:%%M %%p';
$string['strftimetime'] = ''; $string['strftimetime'] = '%%I:%%M %%p';
$string['thislanguage'] = 'English'; $string['thislanguage'] = 'English';
......
...@@ -891,4 +891,17 @@ function fullname($user) { ...@@ -891,4 +891,17 @@ function fullname($user) {
// @todo // @todo
} }
/**
* formats a unix timestamp to a nice date format.
*
* @param int $date unix timestamp to format
* @param string $formatkey language key to fetch the format from
* (see langconfig.php or the top of {@link get_string_location}
* for supported keys
*/
function format_date($date, $formatkey='strftimedatetime') {
return strftime(get_string($formatkey), $date);
}
?> ?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment