I'm having a form with dateControl. The date Control is optional. I'm loading form with
default value. If i set the value for my date control as undefinedor null it showing current date. I need to manually select the date. I don't need default value to assign.
If i have not picked the date, its value should have undefinednot with default value(i.e. Today's Date).
How to do this?
If i set empty string value '' for date control it doesn't diplaying today's date. but when i submit form it show red border around date control.
@gcanti , @alvaromb I need your help
I have the same problem. If you could fix it let me know
You can add this in your field definition (options.fields.yourDateInput):
transformer: {
format: (value) => value,
parse: (value) => value,
},
The default transformer format function inserts today as the default value so it just overrides this behavior.
This solution gives me a display problem though, since there's no date anymore, the touchable is only the size of the label, it's really not convenient, I'd like to be able to put a border and increase the height like a textbox but I haven't found a way to do it yet.
Hi guys!
Sorry for the delay answering, I have tons of work. How do you feel about sending a PR for this?
Most helpful comment
You can add this in your field definition (
options.fields.yourDateInput):The default transformer
formatfunction inserts today as the default value so it just overrides this behavior.This solution gives me a display problem though, since there's no date anymore, the touchable is only the size of the label, it's really not convenient, I'd like to be able to put a border and increase the height like a textbox but I haven't found a way to do it yet.