• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major Major
    • 4.0 alpha
    • None
    • None
    • None

      we cannot inherit from Time, because this returns a date object ; while we want a string and we cannot override getValue since it is used internally.

      what we can do is an abstract field wrapper that will wrap a time and the getValue() will do internalField.getSubmitValue()

      do not forget to transmis any configuration.

      The declaration is commented for now in plugin.xml "widgets.others.stringhour" feature

      Here is a code to start

              /**
               * @cfg {String} format=VeryShortTime Can be "VeryShortTime" to have hours and minutes or "ShortTime" to have seconds additionaly
               */
              
              config.format = config.format == "ShortTime" ? "ShortTime" : "VeryShortTime";
              
              config = Ext.apply(config, {
                  value: config.value == Ametys.form.widget.Date.CURRENT ? new Date() : config.value,
                  format: Ext.Date.patterns[config.format],
                  submitFormat: config.format == "VeryShortTime" ? "H:i" : "H:i:s"
              });
      

          [RUNTIME-1237] The string-time widget has to be made to replace hour

          A bug in ExtJS prevents the time fields from updating their error message if their validity status hasn't changed or if they didn't receive the 'blur' event.

          In this patch we do not use the value of the field in invalidText but a more general message, and we set formatText to '' to avoid an uninternationalized title on the fields.

          Quentin Glinel-Mortreuil (Inactive) added a comment - A bug in ExtJS prevents the time fields from updating their error message if their validity status hasn't changed or if they didn't receive the 'blur' event. In this patch we do not use the value of the field in invalidText but a more general message, and we set formatText to '' to avoid an uninternationalized title on the fields.

          Raphaël Franchet added a comment - - edited

          Patch applied with many modifications. Please correct the following errors:

          • There is always a tooltip in english on the field "Expected time format is"...
          • The first validation error is not updated when another error comes. e.g. enter "foo", you will have the error "foo is not valid". now enter "foo2" the error message stays the same
          • if you enter directly a invalid value the field is correctly in error. But if you first empty the field and then enter an incorrect value, there is no error displayed
          • the field width is wrong, you are using the default 100 px value. Only two choices are ok : a full width widget or a minimal widget widget (with 100px you have many blank space)

          Raphaël Franchet added a comment - - edited Patch applied with many modifications. Please correct the following errors: There is always a tooltip in english on the field "Expected time format is"... The first validation error is not updated when another error comes. e.g. enter "foo", you will have the error "foo is not valid". now enter "foo2" the error message stays the same if you enter directly a invalid value the field is correctly in error. But if you first empty the field and then enter an incorrect value, there is no error displayed the field width is wrong, you are using the default 100 px value. Only two choices are ok : a full width widget or a minimal widget widget (with 100px you have many blank space)

            raphael Raphaël Franchet
            raphael Raphaël Franchet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: