Beispiel #1
0
        def _filter_records_by_days(start_date, end_date, memory_storage_inst):
            if start_date:
                start_date = utils.date_to_timestamp_ext(start_date[0])
            else:
                start_date = memory_storage_inst.get_first_record_day()
            if end_date:
                end_date = utils.date_to_timestamp_ext(end_date[0])
            else:
                end_date = utils.date_to_timestamp_ext('now')

            start_day = utils.timestamp_to_day(start_date)
            end_day = utils.timestamp_to_day(end_date)

            return memory_storage_inst.get_record_ids_by_days(
                six.moves.range(start_day, end_day + 1))
Beispiel #2
0
        def _filter_records_by_days(start_date, end_date, memory_storage_inst):
            if start_date:
                start_date = utils.date_to_timestamp_ext(start_date[0])
            else:
                start_date = memory_storage_inst.get_first_record_day()
            if end_date:
                end_date = utils.date_to_timestamp_ext(end_date[0])
            else:
                end_date = utils.date_to_timestamp_ext('now')

            start_day = utils.timestamp_to_day(start_date)
            end_day = utils.timestamp_to_day(end_date)

            return memory_storage_inst.get_record_ids_by_days(
                six.moves.range(start_day, end_day + 1))
Beispiel #3
0
def _get_week(kwargs, param_name):
    date_param = parameters.get_single_parameter(kwargs, param_name)
    if date_param:
        ts = utils.date_to_timestamp_ext(date_param)
    else:
        ts = vault.get_vault()[param_name]
    return utils.timestamp_to_week(ts)
Beispiel #4
0
def members():
    days = int(flask.request.args.get('days') or DEFAULT_DAYS_COUNT)
    all_days = int(time.time() - utils.date_to_timestamp_ext(
        FIRST_MEMBER_DATE)) / (24 * 60 * 60) + 1

    return {
        'days': days,
        'all_days': all_days
    }
Beispiel #5
0
def members():
    days = int(flask.request.args.get('days') or DEFAULT_DAYS_COUNT)
    all_days = int(time.time() - utils.date_to_timestamp_ext(FIRST_MEMBER_DATE)
                   ) / (24 * 60 * 60) + 1

    return {'days': days, 'all_days': all_days}