File tree 1 file changed +6
-4
lines changed
starlette_admin/statics/js
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,17 @@ $(function () {
105
105
} ) ;
106
106
} else {
107
107
if ( c . type . startsWith ( "moment-" ) ) {
108
- search_format = columns [ c . origData ] . search_format ;
109
- if ( ! search_format ) search_format = moment . defaultFormat ;
108
+ searchFormat = model . fields . find (
109
+ ( f ) => f . name == c . origData
110
+ ) ?. search_format ;
111
+ if ( ! searchFormat ) searchFormat = moment . defaultFormat ;
110
112
c . value = [ ] ;
111
113
if ( c . value1 ) {
112
- c . value1 = moment ( c . value1 ) . format ( search_format ) ;
114
+ c . value1 = moment ( c . value1 ) . format ( searchFormat ) ;
113
115
c . value . push ( c . value1 ) ;
114
116
}
115
117
if ( c . value2 ) {
116
- c . value2 = moment ( c . value2 ) . format ( search_format ) ;
118
+ c . value2 = moment ( c . value2 ) . format ( searchFormat ) ;
117
119
c . value . push ( c . value2 ) ;
118
120
}
119
121
} else if ( c . type == "num" ) {
You can’t perform that action at this time.
0 commit comments