Skip to content

Commit

Permalink
Add support for date histogram format. (#3594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Cam authored and russcam committed Mar 15, 2019
1 parent afa8a7c commit e25e71e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public interface IDateHistogramRollupGrouping
/// </summary>
[JsonProperty("time_zone")]
string TimeZone { get; set; }

/// <summary>
/// Date format. Supports expressive date format pattern.
/// </summary>
[JsonProperty("format")]
string Format { get; set; }
}

/// <inheritdoc />
Expand All @@ -52,6 +58,9 @@ public class DateHistogramRollupGrouping : IDateHistogramRollupGrouping

/// <inheritdoc />
public string TimeZone { get; set; }

/// <inheritdoc />
public string Format { get; set; }
}

/// <inheritdoc cref="IDateHistogramRollupGrouping" />
Expand All @@ -64,6 +73,8 @@ public class DateHistogramRollupGroupingDescriptor<T>
Time IDateHistogramRollupGrouping.Interval { get; set; }
string IDateHistogramRollupGrouping.TimeZone { get; set; }

string IDateHistogramRollupGrouping.Format { get; set; }

/// <inheritdoc cref="IDateHistogramRollupGrouping.Field" />
public DateHistogramRollupGroupingDescriptor<T> Field(Field field) => Assign(a => a.Field = field);

Expand All @@ -78,5 +89,8 @@ public class DateHistogramRollupGroupingDescriptor<T>

/// <inheritdoc cref="IDateHistogramRollupGrouping.TimeZone" />
public DateHistogramRollupGroupingDescriptor<T> TimeZone(string timeZone) => Assign(a => a.TimeZone = timeZone);

/// <inheritdoc cref="IDateHistogramRollupGrouping.Format" />
public DateHistogramRollupGroupingDescriptor<T> Format(string format) => Assign(a => a.Format = format);
}
}

0 comments on commit e25e71e

Please sign in to comment.