View Single Post
Old 04-06-2010, 06:28 PM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax

Code:
pubdate:(><=)YYYY-MM-DD
month and day should be optional.

Similarly for date:
This shouldn't be hard to do. However, be careful with things like pubdate:>2000. If one is not careful, the 2000 would convert to 2000-01-01 for the comparison, which wouldn't work at all.

Given 30 seconds of thought, I think that if one does a equal-length substring match, everything works. pubdate:OP2000 would compare 4 characters. ..:OP2000-10 would compare 7. This should work with all the relational comparisons.

While at it, whoever does this should implement all the relational operators (=, >, <. !=. >=. <=). In addition, comparison strings that aren't valid dates (e.g., 2000-88-54) should raise PARSE_ERROR, which would indicate that the search has an error (search bar becomes pink).
chaley is offline   Reply With Quote