def _set_submission_time_to_query(query, request):
    query[SUBMISSION_TIME] = {}
    try:
        if request.GET.get('start'):
            query[SUBMISSION_TIME]['$gte'] = format_date_for_mongo(
                request.GET['start'])
        if request.GET.get('end'):
            query[SUBMISSION_TIME]['$lte'] = format_date_for_mongo(
                request.GET['end'])
    except __HOLE__:
        return HttpResponseBadRequest(
            _("Dates must be in the format YY_MM_DD_hh_mm_ss"))

    return query
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/viewer/views.py/_set_submission_time_to_query