Michiel Meeuwissen wrote:
Nico Klasens wrote:
  
Hi,

I like to write the following functionality and I was wondering if the 
DateParser can help with thus.
I want to write a CommitProcessor on a datetime field which sets the 
value based on another fields value minus an offset. I like to give the 
CommitPorcessor a param almost like the defaultvalue of a datetime field 
(e.g. <param name="offset">2 weeks</param>). Can I use the DateParser as 
is or do I have to (re)write some stuff.
    

I think you can use the DateParser 'as is'. You first must take the
existing time and present is so that it can be parsed again.

I think e.g. 2006-05-18 14:53 will do.

Then you can add the string '- 2 week' (units are always singular!).

Didn't test it, but I suppose it would work.
  
Great. I tested it and it works. Saved me some time digging through the DateParser code
Thanks,
Nico
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to