Entry Date Validation

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
manoj
Regular
Posts: 49
Joined: Tue Sep 05, 2006 12:20 pm

Entry Date Validation

Post by manoj »

Hi,

The default value of Date filed in entry form is that of system date.
We can also set the Date value manually by entering in textbox. In that case we are able to enter any number and there is no validation for the entered date.

Like for the year value i entered 3663287464646428934-12-06 but when i save entry the year changes to 1214531846.
Is there any solution so that only proper dates are allowed to be entered?

Thanks.
manoj
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Entry Date Validation

Post by garvinhicking »

Hi!

It is expected that you only change a date. Since you see the current date as an example, I think every user should be able to modify it accordingly?

Later on the date is passed to the PHP function strtotime(). This might return strange dates depending on invalid input.

It would be nice to add a javascript date checker that is activated using "onblur" when leaving that datefield. Maybe someone has a validation function for that, so we can implement it?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply