@@ -126,44 +126,44 @@ function SearchFiltersBar({queryJSON, headerButtonsOptions, isMobileSelectionMod
126126 const [ date , displayDate ] = useMemo ( ( ) => {
127127 const value : SearchDateValues = {
128128 [ CONST . SEARCH . DATE_MODIFIERS . ON ] : filterFormValues . dateOn ,
129- [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] : filterFormValues . dateBefore ,
130129 [ CONST . SEARCH . DATE_MODIFIERS . AFTER ] : filterFormValues . dateAfter ,
130+ [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] : filterFormValues . dateBefore ,
131131 } ;
132132
133133 const displayText : string [ ] = [ ] ;
134134 if ( value . On ) {
135135 displayText . push ( isSearchDatePreset ( value . On ) ? translate ( `search.filters.date.presets.${ value . On } ` ) : `${ translate ( 'common.on' ) } ${ DateUtils . formatToReadableString ( value . On ) } ` ) ;
136136 }
137- if ( value . Before ) {
138- displayText . push ( `${ translate ( 'common.before' ) } ${ DateUtils . formatToReadableString ( value . Before ) } ` ) ;
139- }
140137 if ( value . After ) {
141138 displayText . push ( `${ translate ( 'common.after' ) } ${ DateUtils . formatToReadableString ( value . After ) } ` ) ;
142139 }
140+ if ( value . Before ) {
141+ displayText . push ( `${ translate ( 'common.before' ) } ${ DateUtils . formatToReadableString ( value . Before ) } ` ) ;
142+ }
143143
144144 return [ value , displayText ] ;
145- } , [ filterFormValues . dateOn , filterFormValues . dateBefore , filterFormValues . dateAfter , translate ] ) ;
145+ } , [ filterFormValues . dateOn , filterFormValues . dateAfter , filterFormValues . dateBefore , translate ] ) ;
146146
147147 const [ posted , displayPosted ] = useMemo ( ( ) => {
148148 const value : SearchDateValues = {
149149 [ CONST . SEARCH . DATE_MODIFIERS . ON ] : filterFormValues . postedOn ,
150- [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] : filterFormValues . postedBefore ,
151150 [ CONST . SEARCH . DATE_MODIFIERS . AFTER ] : filterFormValues . postedAfter ,
151+ [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] : filterFormValues . postedBefore ,
152152 } ;
153153
154154 const displayText : string [ ] = [ ] ;
155155 if ( value . On ) {
156156 displayText . push ( isSearchDatePreset ( value . On ) ? translate ( `search.filters.date.presets.${ value . On } ` ) : `${ translate ( 'common.on' ) } ${ DateUtils . formatToReadableString ( value . On ) } ` ) ;
157157 }
158- if ( value . Before ) {
159- displayText . push ( `${ translate ( 'common.before' ) } ${ DateUtils . formatToReadableString ( value . Before ) } ` ) ;
160- }
161158 if ( value . After ) {
162159 displayText . push ( `${ translate ( 'common.after' ) } ${ DateUtils . formatToReadableString ( value . After ) } ` ) ;
163160 }
161+ if ( value . Before ) {
162+ displayText . push ( `${ translate ( 'common.before' ) } ${ DateUtils . formatToReadableString ( value . Before ) } ` ) ;
163+ }
164164
165165 return [ value , displayText ] ;
166- } , [ filterFormValues . postedOn , filterFormValues . postedBefore , filterFormValues . postedAfter , translate ] ) ;
166+ } , [ filterFormValues . postedOn , filterFormValues . postedAfter , filterFormValues . postedBefore , translate ] ) ;
167167
168168 const updateFilterForm = useCallback (
169169 ( values : Partial < SearchAdvancedFiltersForm > ) => {
@@ -243,8 +243,8 @@ function SearchFiltersBar({queryJSON, headerButtonsOptions, isMobileSelectionMod
243243 const onChange = ( selectedDates : SearchDateValues ) => {
244244 const dateFormValues = {
245245 postedOn : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . ON ] ,
246- postedBefore : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] ,
247246 postedAfter : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . AFTER ] ,
247+ postedBefore : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] ,
248248 } ;
249249
250250 updateFilterForm ( dateFormValues ) ;
@@ -288,8 +288,8 @@ function SearchFiltersBar({queryJSON, headerButtonsOptions, isMobileSelectionMod
288288 const onChange = ( selectedDates : SearchDateValues ) => {
289289 const dateFormValues = {
290290 dateOn : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . ON ] ,
291- dateBefore : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] ,
292291 dateAfter : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . AFTER ] ,
292+ dateBefore : selectedDates [ CONST . SEARCH . DATE_MODIFIERS . BEFORE ] ,
293293 } ;
294294
295295 updateFilterForm ( dateFormValues ) ;
0 commit comments