Skip to content
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

fix: enable date filter to contain maxYear for filters in custom object #954

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ export class FilterCondition {

renderContent(condition) {
let props = {};
const dateProps = {
displayFormat: 'dd MMM yyyy',
readonly: true,
maxYear: 2080,
minYear: 1970,
};
switch (condition.type) {
case 'TEXT':
case 'NUMBER':
Expand Down Expand Up @@ -172,8 +178,7 @@ export class FilterCondition {
);
case 'DATE':
props = {
displayFormat: 'dd MMM yyyy',
readonly: true,
...dateProps,
value: this.value,
};
return (
Expand All @@ -186,7 +191,10 @@ export class FilterCondition {
></fw-date-condition>
);
case 'DATE_RANGE':
props = { displayFormat: 'dd MMM yyyy', readonly: true, mode: 'range' };
props = {
...dateProps,
mode: 'range',
};
if (this.value) {
const { from: fromDate, to: toDate } = this.value;
if (fromDate && toDate) {
Expand Down
Loading