Click
  1. Click
  2. CLK-610

DateField formatPattern should not be static string, but static variable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      DateField constructors contain this code:

      super(...);
      ...
      setFormatPattern("dd MMM yyyy");
      (yes, same code 3 times

      I suggest to replace it with this:

      public static String defaultFormatPattern = "dd MMM yyyy";

      super(...);
      ...
      setFormatPattern(defaultFormatPattern);

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1h 41m 1 Bob Schellink 17/Jan/10 12:39
        Resolved Resolved Reopened Reopened
        23h 37m 1 Malcolm Edgar 18/Jan/10 12:17
        Reopened Reopened Resolved Resolved
        77d 1h 5m 1 Bob Schellink 05/Apr/10 14:23
        Bob Schellink made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Bob Schellink [ sabob ]
        Resolution Fixed [ 1 ]
        Hide
        Bob Schellink added a comment -

        calendar pattern is now loaded from resource bundle

        Show
        Bob Schellink added a comment - calendar pattern is now loaded from resource bundle
        Bob Schellink made changes -
        Fix Version/s 2.2.0 [ 12314164 ]
        Fix Version/s 2.1.0 [ 12313730 ]
        Hide
        Andrew Fink added a comment -

        Standard Java has similar feature:

        http://java.sun.com/javase/7/docs/api/java/text/DateFormat.html
        http://java.sun.com/docs/books/tutorial/i18n/format/dateFormat.html

        but I can't find how to extract String pattern from DateFormat object,
        but my research wasn't long!

        Just don't forget: date format is a matrix:

        one axis: language/country
        other: format SHORT-to-FULL and date, time or date&time

        Show
        Andrew Fink added a comment - Standard Java has similar feature: http://java.sun.com/javase/7/docs/api/java/text/DateFormat.html http://java.sun.com/docs/books/tutorial/i18n/format/dateFormat.html but I can't find how to extract String pattern from DateFormat object, but my research wasn't long! Just don't forget: date format is a matrix: one axis: language/country other: format SHORT-to-FULL and date, time or date&time
        Malcolm Edgar made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Bob Schellink [ sabob ]
        Hide
        Malcolm Edgar added a comment -

        While this is an improvement over the previous version which had a magic string value, the default value should probably be loaded from a DateField.properties file, as format patterns are local specific.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - While this is an improvement over the previous version which had a magic string value, the default value should probably be loaded from a DateField.properties file, as format patterns are local specific. regards Malcolm Edgar
        Bob Schellink made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Bob Schellink [ sabob ]
        Fix Version/s 2.1.0 [ 12313730 ]
        Resolution Fixed [ 1 ]
        Hide
        Bob Schellink added a comment -

        Fixed in trunk.

        Show
        Bob Schellink added a comment - Fixed in trunk.
        Andrew Fink created issue -

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Andrew Fink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development