Esempio n. 1
0
def quarter(d):
    """
    Return start/stop datetime for the quarter as defined by dt.
    """
    from django_toolkit.datetime_util import quarter as datetime_quarter
    first_date, last_date = datetime_quarter(datetime(d.year, d.month, d.day))
    return first_date.date(), last_date.date()
Esempio n. 2
0
def previous_quarter(d):
    """
    Retrieve the previous quarter for dt
    """
    from django_toolkit.datetime_util import quarter as datetime_quarter
    return quarter( (datetime_quarter(datetime(d.year, d.month, d.day))[0] + timedelta(days=-1)).date() )