null dates
Hi,
In my app I have a null date to begin with and then the user can choose a date from the picker. When I use the below code I am getting the current datetime but I want it to be blank. How can I achieve this?
date={taskTime ? moment.tz(taskTime, businessTimeZone).format("DD-MMM-YYYY, h:mm A") : null}
mode="datetime"
format="DD-MMM-YYYY, h:mm A"
If I use this code I get Invalid Date being displayed which again is not what I want.
date={moment.tz(taskTime, businessTimeZone).format("DD-MMM-YYYY, h:mm A")}
I also need this too.
I want the user to enter their birthdate, but by default it should be blank. Also it should be possible for the user to clear the input.
I too need this
let date = this.props.date; if (date === 'Invalid date') { date = ''; }
Works?
@mike-niemand No its not working. Any other solution ?
add placeholder=" "
placeholder="" does not work placeholder=" " works
This is not working at all for me. If the date is falsey at all, it shows the current date instead of the placeholder. I've tried placeholder="", placeholder=" ", placeholder="Select a Date", date={null}, date={''}.
Can you please fix this? It should simply show the placeholder of the date value is falsey.
This could be a nice feature.
Now I'm using this approach, but is kinda "ugly"
https://stackoverflow.com/questions/60926646/how-to-set-null-for-datetimepicker