Skip to content

Commit

Permalink
Render the dates using current locale.
Browse files Browse the repository at this point in the history
The previous implementation renders the date as  "mm/dd/yy" but many languages prefer the standard format "dd/mm/yy". Moreover, this is easier to read as a header of a timeline or a table.
  • Loading branch information
juacas authored Oct 27, 2022
1 parent 10bbdb1 commit 6ca2513
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions form.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ public function render_timeline_view($data) {
if ($days < ($config->timelinemax * 365)) { // Timeline day span visibility.
$output .= '<table><tr style="height: 65px;">';
for ($d = 0; $d <= $days; $d++) { // Create timeline vertical header.
$date = usergetdate($first["time"] + ($d * (60 * 60 * 24)));
$date = $first["time"] + ($d * (60 * 60 * 24));
$output .= '<th class="vertical-text"><div><span>' .
$date['mon'] . '/' . $date['mday'] . '/' . $date['year'] .
userdate($date, get_string('strftimedatefullshort', 'langconfig')) .
'</span></div></th>';
}
$output .= '</tr><tr>';
Expand Down

1 comment on commit 6ca2513

@juacas
Copy link
Author

@juacas juacas commented on 6ca2513 Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses issue #31

Please sign in to comment.