Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-1251 Widget corrections
  3. RUNTIME-1237

The string-time widget has to be made to replace hour

XMLWordPrintable

    • 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"
              });
      

        1. WEB_StringTime.patch
          3 kB
          Quentin Glinel-Mortreuil

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

              Created:
              Updated:
              Resolved: