1
jegelstaff
Allow YYYY-mm-dd to be a default for date select boxes

Currently, if a module calls the xoopsform class and creates a date select box, and passes a non-date value as the initial value of the box, then the current date gets put in the box.

This makes it impossible to create a date select box that is blank, or has no date in it initially.

Not being able to initialize the date select box with a non-date value means that when the form submission is received, unless the user has specifically cleared a box and made it blank, the current date will be received (since the current date is the current default value).

The problem with that is that the module writer has no way of knowing if the current date is what the user actually picked, or if the user just ignored or neglected to fill in the date select box.

This change solves that problem by allowing the date select box to be initialized with a non-date value (ie: "" is recommended), and that results in YYYY-mm-dd being written into the box as the default value. The popup calendar defaults to the current date in this situation, but the box itself does not contain the current date unless the user specifically selects the current date in the calendar (or types it in).

It's a pretty simple patch, just a few lines changed in two files. You can get it and read more here:

http://sourceforge.net/tracker/?func=detail&aid=1077123&group_id=41586&atid=430842

The link is at the bottom of the page.

Of course, we would like to see this integrated with XOOPS 2.0.9 or later. It doesn't adversely affect existing modules, and allows module writers more accuracy in handling dates using the xoopsform class.

--Julian

2
jegelstaff
Re: Allow YYYY-mm-dd to be a default for date select boxes
  • 2004/12/12 16:15

  • jegelstaff

  • Module Developer

  • Posts: 518

  • Since: 2004/7/2 2


Bump!

I was just wondering if a core developer has had a chance to look into these small changes. They really are very simple, but add some very useful functionality to the date select box. I think they could be added to the core tree without affecting anything else. I notice there has been no response on Sourceforge either.

--Julian

Login

Who's Online

193 user(s) are online (93 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits