> On 2013/5/7 9:51 PM, Hermann D. Schimpf wrote:
>> Hi everyone,
>> I have a trouble developing a add-on for thunderbird.
>> I make a query with Gloda but doesn't works.
>> This is a part of my code where I make the query:
>>
>> let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
>>
>> let yesterday = new Date();
>> yesterday.setDate(yesterday.getDate() - 1);
>>
>> query.dateRange(yesterday, new Date());
I did a quick search through mxr (
http://mxr.mozilla.org/comm-central),
the only instance I've found is here:
http://hg.mozilla.org/releases/comm-esr17/annotate/1834c9586d8f/mailnews/db/gloda/test/unit/base_query_messages.js#l423
which implies you need to make those arguments into an array, i.e.
query.dateRange([yesterday, new Date()]);
On 09/05/2013 00:05, Mark Filipak wrote:
> I don't know what Gloda is and I don't know the arguments for the
> 'query.dateRange' method, but I'll bet an integer between 1 and 31 is
> not what 'query.dateRange' wants. It probably wants a full 'ms since 1
> January 1970 00:00:00' number.
A quick google search and some tests in the Error Console, reveals that
the date calculation is correct:
http://stackoverflow.com/questions/5511323/javascript-yesterday
Mark