Skip to content

Commit

Permalink
#1099: Fix display of start date in advanced search
Browse files Browse the repository at this point in the history
The date widget in the advanced search was displaying a day earlier than
the day it should have. Here is why:
moment/moment#3086
  • Loading branch information
maradragan committed Nov 9, 2018
1 parent ac27d69 commit 6816dd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/src/components/advancedSearch/DateRangeSearch.js
Expand Up @@ -170,8 +170,8 @@ export default class DateRangeSearch extends Component {
const filterValue = {}
if (query[startKey] && query[endKey]) {
filterValue.relative = BETWEEN
filterValue.start = moment(query[startKey]).toISOString()
filterValue.end = moment(query[endKey]).toISOString()
filterValue.start = moment(query[startKey]).format('YYYY-MM-DD')
filterValue.end = moment(query[endKey]).format('YYYY-MM-DD')
toQueryValue[startKey] = query[startKey]
toQueryValue[endKey] = query[endKey]
}
Expand All @@ -183,12 +183,12 @@ export default class DateRangeSearch extends Component {
}
else {
filterValue.relative = AFTER
filterValue.start = moment(query[startKey]).toISOString()
filterValue.start = moment(query[startKey]).format('YYYY-MM-DD')
}
}
else if (query[endKey]) {
filterValue.relative = BEFORE
filterValue.end = moment(query[endKey]).toISOString()
filterValue.end = moment(query[endKey]).format('YYYY-MM-DD')
toQueryValue[endKey] = query[endKey]
}
if (Object.keys(filterValue).length) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/rollup/Show.js
Expand Up @@ -199,7 +199,7 @@ class BaseRollupShow extends Page {
<Fieldset title={
<span>
Daily Rollup - {this.dateLongStr}
<CalendarButton onChange={this.changeRollupDate} value={this.state.date.toISOString()} style={calendarButtonCss} />
<CalendarButton onChange={this.changeRollupDate} value={this.state.date.format('YYYY-MM-DD')} style={calendarButtonCss} />
</span>
} action={
<div>
Expand Down

0 comments on commit 6816dd1

Please sign in to comment.