Announcement

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

    CalendarEvent.getStartDate() ignores custom start date field name set on Calendar

    Follows an excerpt from CalendarEvent.java (SmartGWT 4.1p nightly build, SmartClient Version: v9.1p_2014-06-22/LGPL Development Only (built 2014-06-22))
    It says that the name of the start attribute of the calendar event can be customized n the Calendar instance, so as a user I'd expect that CalendarEvent.getStartDate() eventually returns the value of the custom attribute, but it's not the case, as the attribute name is hardcoded there.

    Code:
        /**
         * Date object which represents the start date of a {@link com.smartgwt.client.widgets.calendar.CalendarEvent}. The name of
         * this field within the CalendarEvent can be changed via {@link
         * com.smartgwt.client.widgets.calendar.Calendar#getStartDateField startDateField}
         *
         * @return Date
         */
        public Date getStartDate()  {
            return getAttributeAsDate("startDate");
        }
    In fact debugging some client code I can see how the calendarEvent has the custom attribute set, but calling getStartDate() returns null.

    #2
    Isomorphic?
    I suspect I've found a bug here. Could you please tell me if I'm wrong?

    Comment


      #3
      This is not a bug - getStartDate() is a getter for startDate.

      If you've supplied a different name for the attribute, use getAttribute("someName")

      Comment


        #4
        Originally posted by Isomorphic View Post
        This is not a bug - getStartDate() is a getter for startDate.

        If you've supplied a different name for the attribute, use getAttribute("someName")
        Sorry, I must admit it is a trivial matter, but please consider modifying the Javadoc... saying it represents the start date of a calendar event as a user I'd expect it eventually returns the value of the attribute representing the event start date, not the value of the attribute named "startDate".

        I often try to sponsor your library, and people blame me for these things :-)
        Last edited by d.cavestro; 3 Jul 2014, 05:57.

        Comment

        Working...
        X