Details
-
Improvement
-
Resolution: Fixed
-
Major
-
8.4
-
None
Description
Currently XWiki LiveTable component allows to search only for particular date match in form yyyy-MM-dd.
I suggest to add feature to search for date ranges if ..._from and ..._to date fields in object class is used. To support this you need to add some kind of following code in XWiki.LiveTableResultsMacros code:
Around line 541: ... #elseif($propType == 'DateClass') #set($fromSql = "${fromSql}, DateProperty ${safe_tableAlias}") #if($colname.indexOf("_from")>0) #set($convtodate=true) #set($whereSql = "${whereSql} and obj.id=${safe_tableAlias}.id.id and ${safe_tableAlias}.id.name = ? and ${safe_tableAlias}.value >= ?") #elseif($colname.indexOf("_to")>0) #set($convtodate=true) #set($whereSql = "${whereSql} and obj.id=${safe_tableAlias}.id.id and ${safe_tableAlias}.id.name = ? and ${safe_tableAlias}.value <= ?") #else #set($convtodate=false) #set($whereSql = "${whereSql} and obj.id=${safe_tableAlias}.id.id and ${safe_tableAlias}.id.name = ? and upper(str(${safe_tableAlias}.value)) like upper(?)") #end #if($convtodate) #set($wheredate=$datetool.toDate("yyyy-MM-dd",$filterValue)) #set($discard = $whereParams.addAll(["${colname}", $wheredate])) #else #set($discard = $whereParams.addAll(["${colname}", "${filterValue}%"])) #end #elseif($propType == 'TextAreaClass' || $propType == 'UsersClass' || $propType == 'GroupsClass') ...
And also update http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro and http://platform.xwiki.org/xwiki/bin/view/DevGuide/LiveTable guides.