This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes date validations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "date validations" Watch "date validations" New topic

date validations

Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
In my application the user selects the ToDate and FromDate fromcombobox.I can able to capture those values as inters in my java program,now i would like to do some validations:
1.ToDate should be less than or equal to CurrentDate.
2.ToDate should be greater than or equal to FromDate.
3.Date Range is limited to 45 days only(parameterized).
I need to develop business rule for the aboue validation.can u give some idea...Thanks.
Amit Agrawal
Ranch Hand

Joined: Aug 23, 2001
Posts: 282
can you please let me know what is your user interface ? is it html (may be genrated by jsp) or AWT/Swing ?
In case its HTML this would be better to do in javascript or if it is AWT there are methods like before() and after() in Date may use them.
Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
Hi Amit,
thax a lot fo rur reply..
My user interface is HTML(generated by jsp), but the client wants to develop it as business object, anyway i just completed the application.
once again thanx a lot..
Roger Wang

Joined: Sep 13, 2001
Posts: 6
for html(jsp) or java UI I know the solution...
but sorry I don't know what is business object,
and how to finished your task as 'business object'?
anyone drop me a line?
Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
Hi wang,
thanx for ur reply..
Business object in the sense, we developed these as a EJB component.
Have you checked out Aspose?
subject: date validations
It's not a secret anymore!