Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Location
    Delhi
    Posts
    8
    Rep Power
    0

    Unhappy Date n Time Display problem

    I have the below code to get the current date n time on jsp page , but it got some display prblm when run on mozilla,Chrome,IE.

    var currentDate = new Date();
    datetimeField.value = currentDate.toLocaleString();
    datetimeField.disabled = true;

    Date n time nt seen and if available then it becomes editable.

    i am using JDK 6.0

    Any Idea........:mad:
    Last edited by kapilverma32; 02-05-2009 at 08:07 PM.

  2. #2
    Jasonre is offline Member
    Join Date
    Jan 2009
    Posts
    40
    Rep Power
    0

    Default

    have you tried using the taglib
    <%@ taglib uri="htt p://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    and then in your jsp where you want to see it displayed do a
    <fmt:formatDate value="${Form.currentDate}" pattern="MMM d, yyyy"/>
    ?

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    You disabled the field, which which I *think* hides it in a browser...

    This is really an HTML question.

  4. #4
    Jasonre is offline Member
    Join Date
    Jan 2009
    Posts
    40
    Rep Power
    0

    Default

    actually it won't hide it in the browser, disabling it means non-editable. yes that is a word in my dictionary! lol

    Using a jstl is a java library, so i would say even though this deals with the presentation layer, it's still somewhat java oriented. Now if he would of asked what disabled="true" does on the html tag, then i would agree :)

    But then again it could be a browser issue, you know stupid IE8 and it's awesomeness to ignore the world's standards! Oh well, for now i still point at my first thought and post on this topic.

  5. #5
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    You're right; I *thought* wrong. Been too long.

    I guess I didn't really understand your question. Is the HTML output showing your component, or is the component missing from the HTML output?

  6. #6
    Join Date
    Oct 2008
    Posts
    73
    Rep Power
    0

    Default

    also now jar file are also availabe

    so if u want it than you can use it directlly in script...
    Rakesh Mehta

  7. #7
    Jasonre is offline Member
    Join Date
    Jan 2009
    Posts
    40
    Rep Power
    0

    Default

    Biggest question for you Kapilverma32 is, are you trying to use JSP to display and have you tried anything else that works?

Similar Threads

  1. Time-Date problem
    By teo.danciu in forum New To Java
    Replies: 5
    Last Post: 08-27-2008, 10:01 AM
  2. Formatting time and date
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:35 PM
  3. Date/Time Servlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-14-2008, 09:34 AM
  4. Time and Date in Java
    By java_fun2007 in forum New To Java
    Replies: 4
    Last Post: 11-06-2007, 07:25 PM
  5. how to get the current date and time
    By valery in forum New To Java
    Replies: 1
    Last Post: 08-03-2007, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •