Skip to content

Commit 5d62641

Browse files
Raza403mdjnelson
authored andcommitted
Added ISO 8601 date format (#638)
1 parent d7fcb8a commit 5d62641

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

classes/element_helper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ public static function get_date_formats(): array {
702702
$dateformats = [
703703
1 => userdate($date, '%B %d, %Y'),
704704
2 => userdate($date, '%B %d' . $suffix . ', %Y'),
705+
5 => userdate($date, '%Y-%m-%d'),
705706
];
706707

707708
$strdateformats = [
@@ -759,6 +760,10 @@ public static function get_date_format_string(int $date, string $dateformat): st
759760
case 4:
760761
$certificatedate = userdate($date, '%B %Y');
761762
break;
763+
case 5:
764+
// ISO 8601 date format (YYYY-MM-DD).
765+
$certificatedate = userdate($date, '%Y-%m-%d');
766+
break;
762767
default:
763768
$certificatedate = userdate($date, get_string('strftimedate', 'langconfig'));
764769
}

0 commit comments

Comments
 (0)