Date Math is great.
NOW/MONTH, NOW/DAY are all working and very useful, so naively I tried 
NOW/WEEK, 
which failed.
Digging into the source code of DateMathParser.java, i found the following 
comment:
   99       // NOTE: consciously choosing not to support WEEK at this time,   
100       // because of complexity in rounding down to the nearest week   101   
    
// arround a month/year boundry.   102       // (Not to mention: it's not clear 
what people would *expect*) 

I was able to implement a work-around in my ruby client using the following 
pseudo code:
  wd=NOW.wday; "NOW-#{wd}DAY/DAY"
This could be extended and integrated into the DateMathParser.java directly 
using the something like the following mapping:
  valWEEKS --> (val*7)DAYS
  date/WEEK --> (date-(date.DAY_OF_WEEK)DAYS)/DAY
What other concerns are there to consider?
Andreas



      

Reply via email to