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 @@
defined('INTERNAL') || die();
$string['parentlanguage'] = '';
$string['strftimedate'] = '';
$string['strftimedateshort'] = '';
$string['strftimedatetime'] = '';
$string['strftimedaydate'] = '',
$string['strftimedaydatetime'] = '';
$string['strftimedayshort'] = '';
$string['strftimedaytime'] = '';
$string['strftimemonthyear'] = '';
$string['strftimerecent'] = '';
$string['strftimerecentfull'] = '';
$string['strftimetime'] = '';
$string['strftimedate'] = '%%d %%B %%Y';
$string['strftimedateshort'] = '%%d %%B';
$string['strftimedatetime'] = '%%d %%B %%Y, %%I:%%M %%p';
$string['strftimedaydate'] = '%%A, %%d %%B %%Y';
$string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = '%%A, %%d %%B';
$string['strftimedaytime'] = '%%a, %%H:%%M';
$string['strftimemonthyear'] = '%%B %%Y';
$string['strftimerecent'] = '%%d %%b, %%H:%%M';
$string['strftimerecentfull'] = '%%a, %%d %%b %%Y, %%I:%%M %%p';
$string['strftimetime'] = '%%I:%%M %%p';
$string['thislanguage'] = 'English';
......
......@@ -891,4 +891,17 @@ function fullname($user) {
// @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