timeinput.pt 973 Bytes
<span tal:define="size size|field.widget.size;
                  css_class css_class|field.widget.css_class;
                  oid oid|field.oid;
                  style style|field.widget.style|None;
                  type_name type_name|field.widget.type_name;"
      tal:omit-tag="">
  ${field.start_mapping()}
  <input type="${type_name}"
         name="time"
         value="${cstruct}"
         tal:attributes="size size;
                         class string: ${css_class or ''} form-control hasDatepicker;
                         style style;
                         attributes|field.widget.attributes|{};"
         id="${oid}"/>
  ${field.end_mapping()}
  <script type="text/javascript">
    deform.addCallback(
      '${oid}',
      function(oid) {
        if (!Modernizr.inputtypes['time'] ||
            "${type_name}" != "time" || window.forceDateTimePolyfill){
          $('#' + oid).pickatime(${options_json});
        }
      }
    );
  </script>
</span>