Great question!
Dates are tricky things on the web due to a lack of an official standard for formatting. However, Cognito Forms uses the defacto standard, ISO 8601, as the format for dates in the JSON format. So in your example, the date would need to be something like "1962-03-29" in order to be processed. Also, when prefilling, the value can be a real JavaScript date, which is not supported in JSON, but is supported by prefill because it accepts a real JavaScript object.
However, this is likely not the cause of your issue. In order to ensure form field names are unique and well-formed in the JSON and code, the field label is used to create a field name that is used when writing calculations, converting to JSON, exporting to Excel, etc. So the name of your field in the JSON likely should be DateOfBirth instead of "Date of Birth".
In order to see the full structure of the form you are trying to prefill, we recommend using RequestBin to see what your form entries look like as JSON. Click on Create a RequestBin, copy the url, select Post JSON data to a website? under Submission Settings, paste the RequestBin url and save your form. Then fill out your form just like your end users would and refresh the RequestBin page to see the JSON.
I am a developer for Cognito Forms.
You are very close to getting the calculation to work, AddDays takes an integer value and the value and what you were generating is a decimal value. You will need to add a little extra code to your Due Date calculation to get it running correctly.
=DateTime.Today.AddDays(Int32(CalculatedTime))
One other change I would make to your calculation in the CalculatedTime field would be to remove the quotation marks (") from around the numebrs, so your calculation looks like this:
=ProjectType = "Flyer: Up to 30 Products" ? 7 : ProjectType = "Flyer: Up to 60 Products" ? 12 : ProjectType = "Flyer: 60+ Products" ? 18 : 7
Best Answer
Check out this blog post by Tyler, one of the great designers at CognitoForms:
Styling Cognito Forms with CSS
Also, you can inspect elements to see the classes applied to them (hint, they all start with
c-
and they are all named sensibly). The class for error messages isc-validation
. You will likely need to use!important
to override any styles explicitly applied by Cognito Forms.