Tengo problemas con el valor de la fecha. El problema es que cuando hago clic en el botón Búsqueda flexible en, aparecerá la fecha de hoy, pero el valor está vacío y no puedo buscar nada en lo que tenga que hacer clic y cambiarlo a cualquier fecha para poder hacer clic en el botón de búsqueda.
Aquí está mi base de código:
getStartDate() { let date = this.props.form["startDate"]; if (date === "") { date = moment().format("MM/DD/YYYY") } return date } render() { const { localize } = this.context; let dateSearch; let datePickerValue: any = this.getStartDate(); if (this.props.form["flexibleSearch"]) { dateSearch = ( <MvSelect name="startDate" onChange={this.handleInput} label={localize('static.content.search-month')} required={true} value={this.props.form["startDate"]} items={this.props.criteria.searchMonths} tabIndex={2} /> ); } else { dateSearch = ( <MvDatePicker id="exact-date" name="startDate" required={true} tabIndex={2} softError={"Date not in range"} items={this.props.criteria.searchMonths} placeholder={localize('static.content.search-by-date')} onChange={this.handleInput} value={datePickerValue} /> Y descubrí que cuando agregué esta línea de código this.props.form["startDate"] = date en la función getStartDate() podrá buscar porque tengo el valor predeterminado, pero si lo hago, perderé el valor predeterminado. el valor cuando busco el mes que es "Buscar por mes" es el valor predeterminado, pero ahora muestra "Oct 2021" como valor predeterminado