Skip to content

Commit

Permalink
Added ISO 8601 date format (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raza403 authored and mdjnelson committed Dec 31, 2024
1 parent a278069 commit 22f6124
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/element_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ public static function get_date_formats(): array {
$dateformats = [
1 => userdate($date, '%B %d, %Y'),
2 => userdate($date, '%B %d' . $suffix . ', %Y'),
5 => userdate($date, '%Y-%m-%d'),
];

$strdateformats = [
Expand Down Expand Up @@ -759,6 +760,10 @@ public static function get_date_format_string(int $date, string $dateformat): st
case 4:
$certificatedate = userdate($date, '%B %Y');
break;
case 5:
// ISO 8601 date format (YYYY-MM-DD).
$certificatedate = userdate($date, '%Y-%m-%d');
break;
default:
$certificatedate = userdate($date, get_string('strftimedate', 'langconfig'));
}
Expand Down

0 comments on commit 22f6124

Please sign in to comment.