These might be useful for index-format-hook pattern matching for some
people.
</itemizedlist>
<para>
<emphasis>offset</emphasis> is specified as a positive number with
- one of the units from <xref linkend="tab-date-units" />.
+ one of the units from <xref linkend="tab-rel-date-units" />.
</para>
+ <table id="tab-rel-date-units">
+ <title>Relative date units</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Unit</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>y</entry>
+ <entry>Years</entry>
+ </row>
+ <row>
+ <entry>m</entry>
+ <entry>Months</entry>
+ </row>
+ <row>
+ <entry>w</entry>
+ <entry>Weeks</entry>
+ </row>
+ <row>
+ <entry>d</entry>
+ <entry>Days</entry>
+ </row>
+ <row>
+ <entry>H</entry>
+ <entry>Hours</entry>
+ </row>
+ <row>
+ <entry>M</entry>
+ <entry>Minutes</entry>
+ </row>
+ <row>
+ <entry>S</entry>
+ <entry>Seconds</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
<para>
Example: to select messages less than 1 month old, you would use
</para>
case 'd':
tm->tm_mday += offset;
break;
+ case 'H':
+ tm->tm_hour += offset;
+ break;
+ case 'M':
+ tm->tm_min += offset;
+ break;
+ case 'S':
+ tm->tm_sec += offset;
+ break;
default:
return s;
}
{
struct Buffer buf;
struct tm min, max;
+ char *offset_type = NULL;
mutt_buffer_init(&buf);
char *pexpr = s->dptr;
if (buf.data[0] == '=')
exact++;
}
- tm->tm_hour = 23;
- tm->tm_min = 59;
- tm->tm_sec = 59;
+
+ /* Reset the HMS unless we are relative matching using one of those
+ * offsets. */
+ strtol(s->data + 1, &offset_type, 0);
+ if (!(*offset_type && strchr("HMS", *offset_type)))
+ {
+ tm->tm_hour = 23;
+ tm->tm_min = 59;
+ tm->tm_sec = 59;
+ }
/* force negative offset */
get_offset(tm, buf.data + 1, -1);