Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2375

Changing the date format of org.apache.wicket.extensions.yui.calendar.DateField does not work

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.4-RC7
    • None
    • wicket-extensions
    • None
    • Windows Vista, JDK 6 update 14

    Description

      I've tried many different ways of changing the date pattern of the selected date in DateField but none worked. I've looked at the produced javascript code and I could see that the datePattern is set to the configured date format (dd-MMM-yy); however, the selected date is still displayed in the following format 'dd-MM-yyyy' .

      Below is my code for creating the DateField and setting the date pattern:

      <code>
      editor = new DateField("editor", new PropertyModel(model, property))
      {
      @Override
      protected DateTextField newDateTextField(String id, PropertyModel model)

      { return DateTextField.withConverter(id, model, new PatternDateConverter("dd-MMM-yy", true)); }

      @Override
      protected DatePicker newDatePicker()
      {
      return new DatePicker()
      {
      @Override
      protected String getDatePattern()

      { return "dd-MMM-yy"; }

      };
      }
      };
      </code>

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ivaynberg Igor Vaynberg
            kyrec Vikash Madhow
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment