Welcome to the Alfresco Builder Network

Our technical resource site is still being improved. We'd love to hear your feedback. Tell us what you think

Implements a date range widget for the Search Filter component.

Date Range Widget

Basic usage

{
    "search": {
        "categories": [
            {
                "id": "createdDateRange",
                "name": "Created Date (range)",
                "enabled": true,
                "component": {
                    "selector": "date-range",
                    "settings": {
                        "field": "cm:created"
                    }
                }
            }
        ]
    }
}

Settings

NameTypeDescription
fieldstringField to apply the query to. Required value
dateFormatstringDate format. Dates used by the datepicker are Moment.js instances, so you can use any date format supported by Moment. Default is 'DD/MM/YYYY'.

Details

This component lets the user select a range between two dates based on the particular field. See the Search filter component for full details of how to use widgets in a search query.

Custom date format

You can set the date range picker to work with any date format your app requires. You can use any date format supported by Moment.js in the dateFormat setting:

{
    "search": {
        "categories": [
            {
                "id": "createdDateRange",
                "name": "Created Date (range)",
                "enabled": true,
                "component": {
                    "selector": "date-range",
                    "settings": {
                        "field": "cm:created",
                        "dateFormat": "DD-MMM-YY"
                    }
                }
            }
        ]
    }
}

See also

Interested in trying Alfresco?

Try Now