On Wed, Jan 05, 2011 at 07:22:18PM -0600, David Champion wrote:
> * On 05 Jan 2011, Toby Cubitt wrote: 
> > 
> > Yes, but how would you use this to e.g. print only the time for all
> > emails received today, but print the date for all emails received
> > yesterday or earlier? A split point of 24h is no use. If it's currently
> 
> That's what nested_if is for.  Here is the date string from my $index_format:
> 
> %<[1y?%<[1w?%<[1d?%[ %H:%M]&%[%a %d]>&%[%b %d]>&%[%y%m%d]>
> 
> that is,
> if < 1y:
>       if < 1w:
>               if < 1d:
>                       %H:%M
>               else:
>                       # >= 1d
>                       %a %d
>       else:  
>               # >= 1w
>               %b %d
> else:
>       # >= 1y
>       %y%m%d
> 
> It does work, or I've been misreading my index for the last 5 years. ;)

Perhaps I'm being dense here. But if it's 10:00 on the 6 January, and
there's an email dated 19:00 on the 5 January, then surely this will
display "19:00"? But I want it to display "Sun 05", because the email is
from yesterday, not today. I'm sure your date format does what you want,
it's just not what I'm talking about.

As far as I recall (it's a long time since I looked at it), the
date_conditional patch straightforwardly compares the email date stamp
against the current time. The <1d conditional is true whenever the email
is dated less than 24h before the current time. That's *not* what I'm
after. When the current time is 00:01 on the 6 Jan, I want an email that
arrived at 23:59 on the 5 Jan to display "Sun 05", even though the email
is only two minutes old.

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: [email protected]
web: www.dr-qubit.org

Reply via email to