To make a long story short.
I have integrated DHTML calendar with Active Scaffold.
Right now I can't get date/time validation working with Active
Scaffold 100%.
Has anyone got this working or approaches it in a different way?
I have been stuck the whole weekend on this issue.
I had a look at Ed Moss's great Demo.
He has the same concept that I and the rest of the developers out
there would like to do.
I see he has a similar problem with date/time validation as I am still
able to enter in text and select the create button.
His Demo as of 08 October 2007 is a lot more robust than mine as it
allows does not render an error when text (eg "Hello") is entered
enter the date field and create button is pressed.
The problem is that I would like to display an active scaffold message
stating that the date is not in a recognized format.
Has anyone succeeded in this or tried another approach and got it
working?
I am currently using PostGreSQL.
You will be pleased to know that Ed Moss has made it compatible
between PostGreSQL and MySQL.
Also I see that Ed has stuck to the default ISO 8601 date time format
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
YYYY-MM-DD HH:MM:SS.
eg 1995-12-30 23:59:59
Excellent.
The PostGreSQL DB date field defaults to this standard now when
installed.
I see that this is now and new standard for the date and many
companies are now enforcing it.
If I can just get the date field in to validate date/time entries then
it will be great.
Regards
Uncle Mike
If so can you please let me know cause I am a little stuck at the
moment.
To that end the plugin now returns a value that can be validated
against as being a bad value in a in the form of 0000-01-
Add something like the following to your validate method in your
model:
errors.add :funding_on, "Funding date must be after 1-1-2000." if
funding_on and (funding_on < Date.new(2000,1,1))
This is now in trunk. Let me know what you think.