MDL-59388 calendar: Add data-time to calendar navigation links

This commit is contained in:
Andrew Nicols
2017-08-14 09:28:11 +08:00
committed by Simey Lameze
parent def443a086
commit b16dca435a
+10 -2
View File
@@ -2173,7 +2173,11 @@ function calendar_get_link_previous($text, $linkbase, $d, $m, $y, $accesshide =
return $text;
}
return link_arrow_left($text, (string)$href, $accesshide, 'previous');
$attrs = [
'data-time' => calendar_get_timestamp($d, $m, $y, $time),
];
return link_arrow_left($text, $href->out(false), $accesshide, 'previous', $attrs);
}
/**
@@ -2196,7 +2200,11 @@ function calendar_get_link_next($text, $linkbase, $d, $m, $y, $accesshide = fals
return $text;
}
return link_arrow_right($text, (string)$href, $accesshide, 'next');
$attrs = [
'data-time' => calendar_get_timestamp($d, $m, $y, $time),
];
return link_arrow_right($text, $href->out(false), $accesshide, 'next', $attrs);
}
/**