Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for date histogram format. #3594

Merged
merged 1 commit into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}