timetrack/cli.py
def parse_time_args(args):
    """"Parse week or month args or uses today by default."""
    if args.week:
        end = datetime.now()
        delta = timedelta(days=7)
        start = end - delta
        start_date = date(start.year, start.month, start.day)
        end_date = date(end.year, end.month, end.day)
    elif args.month:
        end = datetime.now()
        delta = timedelta(days=30)
        start = end - delta
        start_date = date(start.year, start.month, start.day)
        end_date = date(end.year, end.month, end.day)
    else:
        start_date = date.today()
        end_date = date.today()

    return start_date, end_date
Parse week or month args or uses today by default.
Parse week or month args or uses today by default.
Parse week or month args or uses today by default .
def parse_time_args(args):
    if args.week:
        end = datetime.now()
        delta = timedelta(days=7)
        start = end - delta
        start_date = date(start.year, start.month, start.day)
        end_date = date(end.year, end.month, end.day)
    elif args.month:
        end = datetime.now()
        delta = timedelta(days=30)
        start = end - delta
        start_date = date(start.year, start.month, start.day)
        end_date = date(end.year, end.month, end.day)
    else:
        start_date = date.today()
        end_date = date.today()
    return start_date, end_date
def parse_time_args ( args ) : if args . week : end = datetime . now ( ) delta = timedelta ( days = 7 ) start = end - delta start_date = date ( start . year , start . month , start . day ) end_date = date ( end . year , end . month , end . day ) elif args . month : end = datetime . now ( ) delta = timedelta ( days = 30 ) start = end - delta start_date = date ( start . year , start . month , start . day ) end_date = date ( end . year , end . month , end . day ) else : start_date = date . today ( ) end_date = date . today ( ) return start_date , end_date
Parse week or month args or uses today by default.
Parse week or month args or uses today by default .
""""Parse week or month args or uses today by default."""
args