Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateItem without Time

    Hello

    Version v10.1p_2016-03-22/Pro Deployment Chrome 49.0.2623.87 m

    My codes creates a DateItem with inputfields for time:
    Click image for larger version

Name:	dateitem.PNG
Views:	102
Size:	10.5 KB
ID:	238350


    Code:
    Click image for larger version

Name:	codedateitem.PNG
Views:	109
Size:	11.3 KB
ID:	238351

    Don't want time fields. But want arrows for month and year.
    How can i get a simple Datechooser? It worked with the previous version 4

    #2
    The time fields show up by default when the field is declared to be of type "datetime". This is an intentional enhancement. If you want to reverse it for some reason, use DateChooser.showTimeItem - this can be set system-wide via setDefaultProperties().

    Comment


      #3
      As you can see the field is declared as type "DateItem" and not "DateTime". The result is still with Timefields........? What can i do to hide this fields?

      Comment


        #4
        Incorrect: "datetime" is a data type, "DateItem" is a subclass of FormItem. Re-read the previous post more closely - we already answered your question.

        Comment


          #5
          look in the datasource for the data type definition

          Comment


            #6
            Now i can control the "TodayButton", can "TimeItem" disable, but can not hide the timeItem with "setShowTimeItem(false). Also the navigation icon for the calendar do not appear.
            I tried also to set DateItem.setType("date") but it has no effect.

            Click image for larger version

Name:	dateItem_2.PNG
Views:	102
Size:	8.2 KB
ID:	238368

            Code:
            DateChooser dc = new DateChooser();
            dc.setShowTimeItem(false);
            dc.setShowTodayButton(false);
            TimeItem ti = new TimeItem();
            ti.disable();
            dc.setTimeItemProperties(ti);;
            
            
            DateItem didatum = new DateItem("didatum");
            didatum.setTitle("Datum");
            didatum.setPickerProperties(dc);

            Comment


              #7
              why don't you just change the data type to "date"?

              Comment


                #8
                This is just a form to send the formvalues to the server. There is no Datasource...

                I tried to change the type via DateItem.setType("date") but it had no effect..
                Last edited by sachage; 2 Jun 2016, 03:22.

                Comment


                  #9
                  Your code to not show the TimeItem needs to be executed before you create any components. You also should not apply TimeItem properties, even an attempt to disable it, since you are also asking for it not to be shown at all.

                  As far as setType("date") not working to suppress the chooser, we are not reproducing that.

                  Try taking just the relevant code and running it in a new project with nothing else, and using the latest patched version. If you still have a problem there, post the complete code for the test and we can double-check on our end.

                  Comment

                  Working...
                  X