Announcement

Collapse
No announcement yet.

getSelectFilters working with dates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getSelectFilters working with dates

    I am having trouble working out how to use getSelectFilters for dates.
    I would like to setup the following filters
    1) Start Date is <= Today
    2) End Date is Null or >= Today

    Unfortunately I can not find any examples in the source code. Is it possible to have 2 both rules for end date? Any help would be appreciated.

    This is what i have, the value part does not work but I do get an empty filter shown for both fields.
    PHP Code:
            getSelectFilters: function () {
                return {

                    
    'startDate': {
                        
    type'before',
                        
    value'today'
                    
    },
                    
    'endDate': {
                        
    type'after',
                        
    value'today'
                    
    }
                };
            } 

  • #2
    Part of the problem is solved, still looking for a way to handle Null or Future I am thinking I need to extend: \Espo\Core\SelectManagers\Base

    PHP Code:

            getSelectFilters
    : function () {
                return {
                    
    'startDate': {
                        
    type'past'
                    
    },
                    
    'endDate': {
                        
    type'future'
                    
    }
                };
            } 

    Comment

    Working...
    X