Welcome, Guest
Username: Password: Remember me

TOPIC: Validation of date in search field

Validation of date in search field 02 Oct 2012 06:55 #4208

  • Ferm
  • Ferm's Avatar
  • Offline
  • Junior Member
  • Posts: 39
  • Thank you received: 6
  • Karma: 2
Not a big problem, but I noticed that if you drag a date field to a search box (or range in my case), and then enter an invalid date like '123' in the search filed, the application crashes with the following message (both in sandbox and locally):

500 - DateTime::__construct() [datetime.--construct]: Failed to parse time string (30-11-99) at position 7 (9): Unexpected character

I added code to set the date to null if the input is invalid but it owuld be great to have this in the JDom library.
The administrator has disabled public write access.

Re: Validation of date in search field 02 Oct 2012 08:15 #4210

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Not really an answer as such but, I suppose the the most desirable way of handling this would be if the range would adhere to the format of the field it is working with - i.e. in the case of a date/datetime field, providing the calendar type input. This would allow users to pick a date from the calendar.

Not quite sure how to go about modifying this as such but, I'm sure that there are some fellow cooks who could propose some files to change...

Anybody...?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
Time to create page: 0.095 seconds

Get Started