Return a comparison object for the month of the year of a date-time object.
In this context, a date-time object is any object which has a month attribute.
If value is a cf.Comparison object then cf.month(value) is equivalent to value.addattr('month'). Otherwise cf.month(value) is equivalent to cf.eq(value, attr='month').
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> d = cf.dt(2002, 6, 16)
>>> d == cf.month(6)
True
>>> d == cf.month(cf.le(7))
True
>>> d == cf.month(7)
False
>>> d == cf.month(cf.wi(1, 6))
True