if recurrence == 'weeks': # relativedelta doesn't support weeks for some strange reason delta = int(delta.days / 7) else: delta = getattr(delta, recurrence)
John
On Mar 10, 2011, at 6:15 AM, Gustavo Niemeyer wrote:
> Hi John,
>
> There's really no weeks attribute, but there's a 'weeks' keyword which
> is why you may be thinking the former exists.
>
> You can easily get weeks by doing "relativedelta(date1, date2).days /
> 7", though.
>
> ** Changed in: dateutil
> Status: New => Invalid
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/727525
>
> Title:
> relativedelta(date1, date2).weeks fails
>
> Status in python-dateutil:
> Invalid
>
> Bug description:
> Did you forget to implement weeks or am I missing something?
>
> Thanks,
> John Anderson
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/dateutil/+bug/727525/+subscribe
Hi John,
There's really no weeks attribute, but there's a 'weeks' keyword which is why you may be thinking the former exists.
You can easily get weeks by doing "relativedelta( date1, date2).days / 7", though.