mirror of https://github.com/djcb/mu.git
* mu-query: better handle empty lhs/rhs in date intervals
This commit is contained in:
parent
d6337b751e
commit
13efc74793
|
@ -64,10 +64,16 @@ private:
|
|||
const char* str;
|
||||
time_t t;
|
||||
|
||||
str = mu_date_interpret_s (s.c_str(), is_begin ? TRUE: FALSE);
|
||||
str = mu_date_complete_s (str, is_begin ? TRUE: FALSE);
|
||||
t = mu_date_str_to_time_t (str, TRUE /*local*/);
|
||||
str = mu_date_time_t_to_str_s (t, FALSE /*UTC*/);
|
||||
// note: if s is empty and not is_begin, xapian seems
|
||||
// to repeat it.
|
||||
if (s.empty() || g_str_has_suffix (s.c_str(), "..")) {
|
||||
str = mu_date_complete_s ("", is_begin);
|
||||
} else {
|
||||
str = mu_date_interpret_s (s.c_str(), is_begin ? TRUE: FALSE);
|
||||
str = mu_date_complete_s (str, is_begin ? TRUE: FALSE);
|
||||
t = mu_date_str_to_time_t (str, TRUE /*local*/);
|
||||
str = mu_date_time_t_to_str_s (t, FALSE /*UTC*/);
|
||||
}
|
||||
|
||||
return s = std::string(str);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue