diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-04-24 04:23:47 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-04-24 04:23:47 +0800 |
commit | 2a0b181422cfac6025c238e1edc6281a2ac3fba3 (patch) | |
tree | 376d08bc841db7ab8612665654dfab27d68708c8 /widgets | |
parent | c4f279f48009b2176eff5f981b728766d82f10da (diff) | |
download | gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar.gz gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar.bz2 gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar.lz gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar.xz gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.tar.zst gsoc2013-evolution-2a0b181422cfac6025c238e1edc6281a2ac3fba3.zip |
Made it so that if a message is from the last 8 hours, it only prints the
2001-04-23 Christopher James Lahey <clahey@ximian.com>
* e-cell-date.c (ecd_get_text): Made it so that if a message is
from the last 8 hours, it only prints the time, not the date.
svn path=/trunk/; revision=9519
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-cell-date.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 7e48f97a62..00d5ca00aa 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -33,19 +33,35 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) localtime_r (&date, &then); localtime_r (&nowdate, &now); - if (then.tm_mday == now.tm_mday && - then.tm_mon == now.tm_mon && - then.tm_year == now.tm_year) { - strftime (buf, 26, _("Today %l:%M %p"), &then); + + if (nowdate - date < 60 * 60 * 8) { + strftime (buf, 26, _("%l:%M %p"), &then); done = TRUE; } + + if (!done) { + if (then.tm_mday == now.tm_mday && + then.tm_mon == now.tm_mon && + then.tm_year == now.tm_year) { + strftime (buf, 26, _("Today %l:%M %p"), &then); + done = TRUE; + } + } if (!done) { yesdate = nowdate - 60 * 60 * 24; localtime_r (&yesdate, &yesterday); if (then.tm_mday == yesterday.tm_mday && then.tm_mon == yesterday.tm_mon && then.tm_year == yesterday.tm_year) { - strftime (buf, 26, _("Yesterday %l:%M %p"), &then); +#if 0 + if (nowdate - date < 60 * 60 * 12) { + strftime (buf, 26, _("Late Yesterday %l:%M %p"), &then); + } else { +#endif + strftime (buf, 26, _("Yesterday %l:%M %p"), &then); +#if 0 + } +#endif done = TRUE; } } |