-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AAE-3967] Add datetime-range search filter component #6297
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a32ea21
[AAE-3967] Add datetime-range search filter component
4514a3c
Fix bug from max date is not resetting when clicking the clear button
a004684
Fix formatting identation on date-range component
4839409
Add unit tests
867a33b
Add documentation
9524aab
Fix comments
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
docs/content-services/components/search-datetime-range.component.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
Title: Search datetime range component | ||
Added: v4.2.0 | ||
Status: Active | ||
Last reviewed: 2020-11-02 | ||
--- | ||
|
||
# [Search datetime range component](../../../lib/content-services/src/lib/search/components/search-datetime-range/search-datetime-range.component.ts "Defined in search-datetime-range.component.ts") | ||
|
||
Implements a [search widget](../../../lib/content-services/src/lib/search/search-widget.interface.ts) for the [Search Filter component](search-filter.component.md). | ||
|
||
![Date Range Widget](../../docassets/images/search-datetime-range.png) | ||
|
||
## Basic usage | ||
|
||
```json | ||
{ | ||
"search": { | ||
"categories": [ | ||
{ | ||
"id": "createdDatetimeRange", | ||
"name": "Created Datetime (range)", | ||
"enabled": true, | ||
"component": { | ||
"selector": "datetime-range", | ||
"settings": { | ||
"field": "cm:created" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
### Settings | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| field | string | Field to apply the query to. Required value | | ||
| datetimeFormat | string | Datetime format. Datetime formats used by the datetime picker are [Moment.js](https://momentjs.com/docs/#/parsing/string-format/) instances, so you can use any datetime format supported by Moment. Default is 'DD/MM/YYYY HH:mm'. | | ||
| maxDatetime | string | A fixed datetime that will set the maximum searchable datetime. Default is no maximum. | | ||
|
||
## Details | ||
|
||
This component lets the user select a range between two dates and times based on the particular `field`. | ||
See the [Search filter component](search-filter.component.md) for full details of how to use widgets | ||
in a search query. | ||
|
||
### Custom datetime format | ||
|
||
You can set the datetime range picker to work with any datetime format your app requires. You can use | ||
any datetime format supported by [Moment.js](https://momentjs.com/docs/#/parsing/string-format/) | ||
in the `datetimeFormat` and in the `maxDatetime` setting: | ||
|
||
```json | ||
{ | ||
"search": { | ||
"categories": [ | ||
{ | ||
"id": "createdDateTimeRange", | ||
"name": "Created Datetime (range)", | ||
"enabled": true, | ||
"component": { | ||
"selector": "datetime-range", | ||
"settings": { | ||
"field": "cm:created", | ||
"datetimeFormat": "DD-MMM-YY HH:mm:ss", | ||
"maxDatetime": "10-Mar-20 20:00" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
## See also | ||
|
||
- [Search filter component](search-filter.component.md) | ||
- [Search check list component](search-check-list.component.md) | ||
- [Search number range component](search-number-range.component.md) | ||
- [Search radio component](search-radio.component.md) | ||
- [Search slider component](search-slider.component.md) | ||
- [Search text component](search-text.component.md) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't be search-datetime-range.component.ts instead of search-date-range.component.ts?