Re: Question about date formatter.
Re: Question about date formatter.
- Subject: Re: Question about date formatter.
- From: Chuck Hill <email@hidden>
- Date: Fri, 26 Mar 2004 09:51:25 -0800
Creating a custom formatter is your best best. You will find it quite
easy. All you need to do is to check if the last set of numbers is of
length 2. If so, create a new string inserting the missing 20 and then
pass that string to super.
Chuck
On Mar 26, 2004, at 7:07 AM, Albert Jagnow wrote:
I have an application that has many user entered dates used to track
various things. I want the dates to display in the form MM/DD/YYYY,
for
example 3/26/2004. I want to have the users enter the dates in this
same format as well. I use a dateformat on the form field that is
"%m/%d/%Y". The problem I am having is that some users will enter the
date with only a two digit year, like 3/26/04. WebObjects changes this
to 3/26/0004. Now I realize that I could validate these fields and
make
sure the date was after the year 100 or 2000 for that matter and
generate an error, but I have many date fields in the application.
What
I would rather do is if the user entered 04 just change it to 2004
automatically. Is there a way to do this easily? Could I create a
custom formatter to do this? How do others deal with this problem?
--Albert
This e-mail (including any attachments) is covered by the Electronic
Communications Privacy Act, 18 USC. 2510-2521. It is confidential and
may be legally privileged. If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited. Please reply to
the sender that you have received the message in error, and then delete
it. Thank you.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.