Fixed timezone handling for "on or before" date member filters
no issue - `settings.get('timezone')` had a typo in the "on or before" nql filter generation meaning the date wasn't correctly converted to the site timezone when applying the filter
This commit is contained in:
parent
14b80ae6ef
commit
7e85e84a2d
|
@ -241,20 +241,22 @@ export default class MembersFilter extends Component {
|
|||
} else if (filterProperty.valueType === 'date') {
|
||||
let filterValue;
|
||||
|
||||
let tzMoment = moment.tz(moment(filter.value).format('YYYY-MM-DD'), this.settings.get('timezone'));
|
||||
|
||||
if (relationStr === '>') {
|
||||
const tzMoment = moment.tz(moment(filter.value).format('YYYY-MM-DD'), this.settings.get('timezone')).set({hour: 23, minute: 59, second: 59});
|
||||
tzMoment = tzMoment.set({hour: 23, minute: 59, second: 59});
|
||||
filterValue = `'${tzMoment.utc().format(nqlDateFormat)}'`;
|
||||
}
|
||||
if (relationStr === '>=') {
|
||||
const tzMoment = moment.tz(moment(filter.value).format('YYYY-MM-DD'), this.settings.get('timezone')).set({hour: 0, minute: 0, second: 0});
|
||||
tzMoment = tzMoment.set({hour: 0, minute: 0, second: 0});
|
||||
filterValue = `'${tzMoment.utc().format(nqlDateFormat)}'`;
|
||||
}
|
||||
if (relationStr === '<') {
|
||||
const tzMoment = moment.tz(moment(filter.value).format('YYYY-MM-DD'), this.settings.get('timezone')).set({hour: 0, minute: 0, second: 0});
|
||||
tzMoment = tzMoment.set({hour: 0, minute: 0, second: 0});
|
||||
filterValue = `'${tzMoment.utc().format(nqlDateFormat)}'`;
|
||||
}
|
||||
if (relationStr === '<=') {
|
||||
const tzMoment = moment.tz(moment(filter.value).format('YYYY-MM-DD'), this.settings.get('timeone')).set({hour: 23, minute: 59, second: 59});
|
||||
tzMoment = tzMoment.set({hour: 23, minute: 59, second: 59});
|
||||
filterValue = `'${tzMoment.utc().format(nqlDateFormat)}'`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue