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. To avoid formatting and reparsing, you may want to change the DateParser though (perhaps one should somehow be able to override 'now' with the value of this other field). Michiel -- Michiel Meeuwissen mihxil' Peperbus 107 MediaPark H'sum [] () +31 (0)35 6772979 nl_NL eo_XX en_US _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
