jsf inputCalendar

Posted on 2006-05-05
Last Modified: 2010-05-18

I have one bean form in which i m setting birthday = 47/02/01 (year = 1947)
in database i m saving it as mm/dd/yyyy hh:mm:ss

then when i click next birthday appears in the textbox and there i m setting calendar like :

<t:inputCalendar value="#{userBean.user.birthDate}" renderAsPopup="true" id="birthDate" style="width:25em;" >
                                      <f:convertDateTime type="date" dateStyle="short" />

but thing is tht whenever i click on each date chooser in turn then the year comes up as 2047 for the birth date and not the 1947.
Question by:gdv82
    LVL 30

    Expert Comment

    >> birthday = 47/02/01 (year = 1947)

    Probably its getting saved as 2047 and not 1947.
    LVL 30

    Expert Comment

    Can you not set it as 1947/02/01 explicitly?

    Author Comment


    i need short date format and moreover in the database it is saving the correct year value only.
    LVL 30

    Accepted Solution

    >> in the database it is saving the correct year value only

    Then the problem could be that in the retrieved object, userBean.user.birthDate is being stored as 2047. You might need to figure out where that change is happening (whether the object has that wrong value or whether the calendar is buggy and considers 47 to be 2047, that's not really a bug I think).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    Tips on building some plugins or small utility apps 3 54
    Multiple issues with Java 14 37
    nested interface 5 29
    countAbc challenge 9 35
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now