Last modified: 2014-10-09 08:20:58 UTC
mw is able to calculate with parser variable #time e.g. to add or subtract months to the given time. python does not support it with standard libs and dateutils is not part of the framework. On the other hand it would be great to have such a feature calculating months with Timestamps.
Timestamp is a subclass of datetime.datetime. Can't we just use timedelta? https://docs.python.org/2/library/datetime.html#timedelta-objects This is what I did in newitem.py or do you want to do something else?
The problem is that months have different days between 28 an 31. Adding 1 month to 7th September should result in 7th October. Adding 7th October should give 7th November as result. dateutils does it. The highest timedelta resolution is "days" not "months". We could use constants from calendar module to implement it. I need it to calculate log entries. mw is able to calculate time stamps by adding months and years, whereas datetime objects aren't able to.