mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-19 19:42:59 -04:00
Add machine-readable dates in views (#3106)
This will allow to make some transformations on dates when needed. See #3103 and #853
This commit is contained in:
committed by
GitHub
parent
877f5f539b
commit
8d8211b2a5
@@ -87,9 +87,11 @@ class FreshRSS_Entry extends Minz_Model {
|
||||
public function date($raw = false) {
|
||||
if ($raw) {
|
||||
return $this->date;
|
||||
} else {
|
||||
return timestamptodate($this->date);
|
||||
}
|
||||
return timestamptodate($this->date);
|
||||
}
|
||||
public function machineReadableDate() {
|
||||
return @date (DATE_ATOM, $this->date);
|
||||
}
|
||||
public function dateAdded($raw = false, $microsecond = false) {
|
||||
if ($raw) {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<?php } ?>
|
||||
</li><?php
|
||||
if ($bottomline_date) {
|
||||
?><li class="item date"><?= $this->entry->date() ?></li><?php
|
||||
?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time> </li><?php
|
||||
}
|
||||
if ($bottomline_link) {
|
||||
?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= _i('link') ?></a></li><?php
|
||||
|
||||
@@ -44,6 +44,6 @@
|
||||
?></span><?php
|
||||
endif;
|
||||
?></a></li>
|
||||
<?php if ($topline_date) { ?><li class="item date"><?= $this->entry->date() ?> </li><?php } ?>
|
||||
<?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time> </li><?php } ?>
|
||||
<?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= _i('link') ?></a></li><?php } ?>
|
||||
</ul>
|
||||
|
||||
@@ -62,8 +62,7 @@ $content_width = FreshRSS_Context::$user_conf->content_width;
|
||||
endforeach;
|
||||
echo ' — ';
|
||||
endif;
|
||||
echo $item->date();
|
||||
?></div><div class="text">
|
||||
?><time datetime="<?= $item->machineReadableDate() ?>"><?= $item->date() ?></time></div><div class="text">
|
||||
<?= $item->content() ?>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user