Announcement

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

    calendar.setChosenDate issue

    Hi
    We are using v8.3p_2013-03-21/PowerEdition Deployment 2013-03-21

    When trying to set the chosenDate like
    chosenDate:"new date()",
    or like chosenDate:"2013-04-19",
    I get an error
    TypeError: this.chosenDate.getFullYear is not a function

    And If I try to set it like calendar.setChosenDate("2013-04-19");
    I get an error
    TypeError: _1.getFullYear is not a function

    What is going wrong here? How do I set the chosenDate?

    #2
    By passing it an actual Date - your first example without the quotes is correct:

    chosenDate: new Date()

    Comment


      #3
      That does not throw an error but it has no effect. The date is not highlighted in the monthview.

      Please see the screenshot attached.
      Attached Files

      Comment


        #4
        No, and that's correct - chosenDate dictates which events are loaded in the current view; the chosenDate itself, or the week/month in which the chosenDate exists - the only place you will see a date hilited is in the Date-Picker popup window.

        Comment


          #5
          Ok. Then how do I highlight the current date of the monthview on create?
          Here is my code for the calendar.
          Code:
          isc.Calendar.create({
                  ID: "taskCalendar", 
                  width: 500,
                  height: 220,
                  showDayView: false,
                  showWeekView: false,
                  showOtherDays: false,
                  showDayHeaders: false,
                  showDateChooser: false,
                  showDatePickerButton: false,
                  showAddEventButton: false,
                  disableWeekends: false,
                  //dataSource: eventDS,
                  chosenDate:new Date(),
                  todayBackgroundColor:"#FFFF00",
                  autoFetchData: true,
                  canCreateEvents : false,
                  getDayBodyHTML : function (date, events, calendar, rowNum, colNum) {
                      returnStr = date.getDate() + " ";
                    
                      return returnStr;
                  },
                  dayBodyClick : function (date, events, calendar, rowNum, colNum) {
                  
                      var advancedCriteria1 = {
                                  _constructor: "AdvancedCriteria",
                                  operator: "and",
                                  criteria:[
              						//{fieldName: "todotype",operator: "equals", value:1},
              						{ fieldName: "todoplandate", operator: "greaterOrEqual", value: (new Date(date.setHours(00, 00, 00, 0))) },
              						{ fieldName: "todoplandate", operator: "lessOrEqual", value: (new Date(date.setHours(23, 59, 59, 0))) }
              					]
          			};
          			ListGrid0.fetchData(advancedCriteria1);
                  }
                  
                  
          });
          Last edited by kmkale; 19 Apr 2013, 03:44. Reason: added code

          Comment


            #6
            We've made a change to have this behave as you expect - please retest with a build dated April 22 or later
            Last edited by Isomorphic; 21 Apr 2013, 21:28.

            Comment

            Working...
            X