Skip to content

Commit

Permalink
fix(ListFilterDateRange): Fix null field in query
Browse files Browse the repository at this point in the history
Now when endDateField is null, it will fall back to using just startDateField
  • Loading branch information
jcarter committed Dec 3, 2018
1 parent fd19c04 commit d8c714c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/model/ListFilterDateRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ public function applyFilter(SS_List $list, array $data) {
* @return SS_List
*/
public function applyDateRange(SS_List $list, $start, $end) {
// get both date fields, or a single field
$startDateField = $this->StartDateField;
$endDateField = $this->EndDateField;
$endDateField = $this->EndDateField ?: $startDateField;

// Use DateField to convert from the date format to 'yyyy-mm-dd' for
// database use.
Expand Down

0 comments on commit d8c714c

Please sign in to comment.