Skip to content

Commit e1f4183

Browse files
FabienLavocatMpdreamz
authored andcommitted
Make the ExtendedBounds property of the DateHistogramAggregation to use DateMath instead of DateTime
1 parent 56c01a6 commit e1f4183

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Nest/Aggregations/Bucket/DateHistogram/DateHistogramAggregation.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface IDateHistogramAggregation : IBucketAggregation
3737
HistogramOrder Order { get; set; }
3838

3939
[JsonProperty("extended_bounds")]
40-
ExtendedBounds<DateTime> ExtendedBounds { get; set; }
40+
ExtendedBounds<DateMath> ExtendedBounds { get; set; }
4141

4242
[JsonProperty("missing")]
4343
DateTime? Missing { get; set; }
@@ -68,7 +68,7 @@ public string Format
6868
public string TimeZone { get; set; }
6969
public string Offset { get; set; }
7070
public HistogramOrder Order { get; set; }
71-
public ExtendedBounds<DateTime> ExtendedBounds { get; set; }
71+
public ExtendedBounds<DateMath> ExtendedBounds { get; set; }
7272
public DateTime? Missing { get; set; }
7373

7474
internal DateHistogramAggregation() { }
@@ -113,7 +113,7 @@ string IDateHistogramAggregation.Format
113113

114114
HistogramOrder IDateHistogramAggregation.Order { get; set; }
115115

116-
ExtendedBounds<DateTime> IDateHistogramAggregation.ExtendedBounds { get; set; }
116+
ExtendedBounds<DateMath> IDateHistogramAggregation.ExtendedBounds { get; set; }
117117

118118
DateTime? IDateHistogramAggregation.Missing { get; set; }
119119

@@ -148,8 +148,8 @@ public DateHistogramAggregationDescriptor<T> OrderAscending(string key) =>
148148
public DateHistogramAggregationDescriptor<T> OrderDescending(string key) =>
149149
Assign(a => a.Order = new HistogramOrder { Key = key, Order = SortOrder.Descending });
150150

151-
public DateHistogramAggregationDescriptor<T> ExtendedBounds(DateTime min, DateTime max) =>
152-
Assign(a=>a.ExtendedBounds = new ExtendedBounds<DateTime> { Minimum = min, Maximum = max });
151+
public DateHistogramAggregationDescriptor<T> ExtendedBounds(DateMath min, DateMath max) =>
152+
Assign(a=>a.ExtendedBounds = new ExtendedBounds<DateMath> { Minimum = min, Maximum = max });
153153

154154
public DateHistogramAggregationDescriptor<T> Missing(DateTime missing) => Assign(a => a.Missing = missing);
155155
}

src/Tests/Aggregations/Bucket/DateHistogram/DateHistogramAggregationUsageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public DateHistogramAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage
9999
Interval = DateInterval.Month,
100100
MinimumDocumentCount = 2,
101101
Format = "yyyy-MM-dd'T'HH:mm:ss",
102-
ExtendedBounds = new ExtendedBounds<DateTime>
102+
ExtendedBounds = new ExtendedBounds<DateMath>
103103
{
104104
Minimum = FixedDate.AddYears(-1),
105105
Maximum = FixedDate.AddYears(1),

0 commit comments

Comments
 (0)