use relativedate as the css class for dates that should display relative
parent
99bf734963
commit
ee1ccfa863
|
@ -53,7 +53,7 @@ sub display ($;$) { #{{{
|
|||
my $gmtime=decode_utf8(POSIX::strftime("%a, %d %b %Y %H:%M:%S %z",
|
||||
localtime($time)));
|
||||
|
||||
return '<span class="date" title="'.$gmtime.'">'.
|
||||
return '<span class="relativedate" title="'.$gmtime.'">'.
|
||||
IkiWiki::formattime($time, $format).'</span>';
|
||||
} #}}}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ show the absolute date instead. Also, this plugin can be used with other
|
|||
plugins like [[prettydate]] that change how the absolute date is displayed.
|
||||
|
||||
If this plugin is enabled, you may also add relative dates to pages in the
|
||||
wiki, by using html elements in the "date" class. For example, this will
|
||||
display as a relative date:
|
||||
wiki, by using html elements in the "relativedate" class. For example, this
|
||||
will display as a relative date:
|
||||
|
||||
<span class="date">Fri Oct 17 18:36:13 EDT 2008</span>
|
||||
<span class="relativedate">Fri Oct 17 18:36:13 EDT 2008</span>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Causes html elements in the 'date' and 'pagedate' classes to be displayed
|
||||
// Causes html elements in the 'relativedate' class to be displayed
|
||||
// as relative dates. The date is parsed from the title attribute, or from
|
||||
// the element content.
|
||||
|
||||
|
@ -7,7 +7,7 @@ var dateElements;
|
|||
hook("onload", getDates);
|
||||
|
||||
function getDates() {
|
||||
dateElements = getElementsByClass('date');
|
||||
dateElements = getElementsByClass('relativedate');
|
||||
for (var i = 0; i < dateElements.length; i++) {
|
||||
var elt = dateElements[i];
|
||||
var title = elt.attributes.title;
|
||||
|
|
Loading…
Reference in New Issue