def angular_datepicker(datestr):
    if ((datestr is None) or hasattr(datestr, 'isoformat')):
        return datestr
    return datetime.datetime.strptime(datestr[:10], '%Y-%m-%d').date()
def angular_datepicker(datestr):
    if ((datestr is None) or hasattr(datestr, 'isoformat')):
        return datestr
    return datetime.datetime.strptime(datestr[:10], '%Y-%m-%d').date()