@@ -90,20 +90,29 @@ function Placeholder(props) {
90
90
const [ isDraggingEnabled , setDraggingEnabled ] = useState ( true ) ;
91
91
const [ isShowDateFormat , setIsShowDateFormat ] = useState ( false ) ;
92
92
const [ selectDate , setSelectDate ] = useState ( {
93
- date : moment (
94
- getDefaultdate (
95
- props ?. pos ?. options ?. response ,
96
- props . pos ?. options ?. validation ?. format
97
- ) . getTime ( )
98
- ) . format ( changeDateToMomentFormat ( props . pos ?. options ?. validation ?. format ) ) ,
99
- format : getDefaultFormat ( props . pos ?. options ?. validation ?. format )
93
+ date :
94
+ props . pos . type === "date"
95
+ ? moment (
96
+ getDefaultdate (
97
+ props ?. pos ?. options ?. response ,
98
+ props . pos ?. options ?. validation ?. format
99
+ ) . getTime ( )
100
+ ) . format (
101
+ changeDateToMomentFormat ( props . pos ?. options ?. validation ?. format )
102
+ )
103
+ : "" ,
104
+ format :
105
+ props . pos . type === "date"
106
+ ? getDefaultFormat ( props . pos ?. options ?. validation ?. format )
107
+ : ""
100
108
} ) ;
101
109
const [ dateFormat , setDateFormat ] = useState ( [ ] ) ;
102
110
const [ startDate , setStartDate ] = useState (
103
- getDefaultdate (
104
- props ?. pos ?. options ?. response ,
105
- props . pos ?. options ?. validation ?. format
106
- )
111
+ props . pos . type === "date" &&
112
+ getDefaultdate (
113
+ props ?. pos ?. options ?. response ,
114
+ props . pos ?. options ?. validation ?. format
115
+ )
107
116
) ;
108
117
const dateFormatArr = [
109
118
"L" ,
@@ -117,6 +126,7 @@ function Placeholder(props) {
117
126
"DD MMMM, YYYY"
118
127
] ;
119
128
129
+ useEffect ( ( ) => { } , [ ] ) ;
120
130
//function change format array list with selected date and format
121
131
const changeDateFormat = ( ) => {
122
132
const updateDate = [ ] ;
0 commit comments