def METHOD_NAME(aggregation, step=86400000):
    """Add a configuration block for date buckets.
    :param aggregation: the aggregation to process.
    :param step: the number of millis for each step. By default : 1 day.
    """
    if values := [term['key'] for term in aggregation.get('buckets', [])]:
        aggregation['type'] = 'date-range'
        aggregation['config'] = {
            'min': min(values),
            'max': max(values),
            'step': step  # 1 day in millis
        }