Announcement

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

    dateitem to only show month/year

    Hi guys,

    have looked at apidocs and played around a little, but to no avail.

    Is there some smart way to use the dateitem without the date? I need a control to select a month in a year, and haven't gotten it to work or found another component.

    It's not that hard to do it myself, i know, but the widget is pretty neat, with the picker on the side, language controls, etc.

    Thankful for pointers!

    #2
    Hello,

    for SmartGWT, you can use:

    Code:
    DateItem fromDateMonth = new DateItem();  
    fromDateMonth.setAttribute("selectorFormat", DateItemSelectorFormat.MONTH_YEAR);
    I am looking a way to have the year only:
    Code:
    DateItem fromDateMonth = new DateItem();  
    fromDateMonth.setAttribute("selectorFormat", "Y");
    It displays the year selectItem but when I want to retrieve the value, it is said to be Invalid...

    Any ideas?

    Comment


      #3
      Thank You, works splendidly!

      May i ask how you found this little gem of functionality? I always look at the javadocs, but they does not mention this attribute, nor did I find any example that does this.

      Comment


        #4
        Glad it helped...

        it came from try and error with the attribute names I saw after running dateItem,getAttributes()

        Comment


          #5
          The API DateItem.setSelectorFormat(DateItemSelectorFormat selectorFormat) has been added.

          Comment


            #6
            Great!

            Thanks for the support

            Comment

            Working...
            X