Announcement

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

    DateChooser with only Months and Years

    "v10.0p_2015-06-18/Pro Edition"

    Hi,

    Is possible modify the "DataChooser Picker" for showing only Months and Years? I Can't find any solution in the forums.

    I tried this code:
    field.editorType= "DateItem"; field.useTextField= true; field.useMask= false; field.dateFormatter= "MM/YYYY"; the "field" is a field of listGrid.


    To clarify the user can insert a date for example "09/2017" and in the system I can save 01/09/2017.

    Thanks All


    Click image for larger version  Name:	dataChooser.PNG Views:	1 Size:	12.7 KB ID:	248874
    Starts
    1 Sep 2017
    Ends
    1 Sep 2017
    Last edited by peppe; 1 Sep 2017, 07:02.

    #2
    We don't offer a setting on the DateChooser to hide the calendar since that's really its central feature. However, you could set pickerConstructor and pickerProperties on the editorProperties of the ListGridField so that it creates an instance of your own class. Or you could just hide the picker by setting the following on the ListGridField:
    Code:
    editorProperties: {showPickerIcon: false}
    If you decide to hide the picker, you could also switch the free-form text field of the DateItem to a month/year picker, by setting the following on the ListGridField:
    Code:
    useTextField: false, editorProperties: {showPickerIcon: false, selectorFormat: "MY"}
    See here for more info on DateItem.selectorFormat.

    Comment


      #3
      Thanks you, this works perfect.
      This is my code now :
      Code:
      field.editorType= "DateItem";
      field.dateFormatter= "MM/YYYY"; // show date es. 09/2017
      field.editorProperties = { showPickerIcon: false, selectorFormat: "MY", useTextField: false , }
      But I have another problem. When I save the date on db, the date that arrive server-side is es. "30/09/2017", the last day of every months, is possible set the date a default Day to "1" , I have tried daySelectorProperties but it's ignored, is there a function that set the day?

      Thanks all!

      Comment


        #4
        According to the documentation for selectorFormat, setting the defaultValue of the formItem should allow the parts of the date not accessible via the pickers to be set. Have you tried setting defaultValue?

        Comment

        Working...
        X