1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 20:55:56 +00:00

option HEADLINES_SMART_DATE

This commit is contained in:
Andrew Dolgov
2005-11-28 08:43:03 +01:00
parent 63186cdb78
commit be773442d2
4 changed files with 31 additions and 2 deletions

View File

@@ -737,4 +737,24 @@
return null;
}
}
function smart_date_time($timestamp) {
if (date("Y.m.d", $timestamp) == date("Y.m.d")) {
return date("G:i", $timestamp);
} else if (date("Y.m", $timestamp) == date("Y.m")) {
return date("M d, G:i", $timestamp);
} else {
return date("Y/m/d G:i");
}
}
function smart_date($timestamp) {
if (date("Y.m.d", $timestamp) == date("Y.m.d")) {
return "Today";
} else if (date("Y.m", $timestamp) == date("Y.m")) {
return date("D m", $timestamp);
} else {
return date("Y/m/d");
}
}
?>