* mu-query: better handle empty lhs/rhs in date intervals
This commit is contained in:
@ -64,10 +64,16 @@ private:
|
|||||||
const char* str;
|
const char* str;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
str = mu_date_interpret_s (s.c_str(), is_begin ? TRUE: FALSE);
|
// note: if s is empty and not is_begin, xapian seems
|
||||||
str = mu_date_complete_s (str, is_begin ? TRUE: FALSE);
|
// to repeat it.
|
||||||
t = mu_date_str_to_time_t (str, TRUE /*local*/);
|
if (s.empty() || g_str_has_suffix (s.c_str(), "..")) {
|
||||||
str = mu_date_time_t_to_str_s (t, FALSE /*UTC*/);
|
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);
|
return s = std::string(str);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user