Skip to content

Commit

Permalink
Adding fix for GPFILTERPANE-124
Browse files Browse the repository at this point in the history
  • Loading branch information
christian.oestreich committed Jul 24, 2014
1 parent 511793c commit 07aac16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FilterpaneGrailsPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class FilterpaneGrailsPlugin {
def version = "2.4.4"
def version = "2.4.5"
def grailsVersion = "2.4 > *"

def author = "Grails Plugin Consortium"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ class FilterPaneService {
// GRAILSPLUGINS-1320. If value is instance of Date and op is Equal and
// precision on date picker was 'day', turn this into a between from
// midnight to 1 ms before midnight of the next day.
boolean isDayPrecision = "y".equals(filterParams["${domainProperty?.domainClass?.name}.${domainProperty?.name}_isDayPrecision"])
boolean isOpAlterable = (op == FilterPaneOperationType.Equal || op == FilterPaneOperationType.NotEqual)
boolean isDayPrecision = "y".equalsIgnoreCase(filterParams["${domainProperty?.domainClass?.name}.${domainProperty?.name}_isDayPrecision"]) || "y".equalsIgnoreCase(filterParams["${domainProperty?.name}_isDayPrecision"])
boolean isOpAlterable = (op == FilterPaneOperationType.Equal || op == FilterPaneOperationType.NotEqual || op == FilterPaneOperationType.Equal.operation || op == FilterPaneOperationType.NotEqual.operation)
if (value != null && isDayPrecision && Date.isAssignableFrom(value.class) && isOpAlterable) {
op = (op == FilterPaneOperationType.Equal) ? 'Between' : 'NotBetween'
op = (op == FilterPaneOperationType.Equal || op == FilterPaneOperationType.Equal.operation) ? 'Between' : 'NotBetween'
value = FilterPaneUtils.getBeginningOfDay(value)
value2 = FilterPaneUtils.getEndOfDay(value)
log.debug("Date criterion is Equal to day precision. Changing it to between ${value} and ${value2}")
Expand Down

0 comments on commit 07aac16

Please sign in to comment.