rem: var dayNumber = document.getElementById( "start-date-picker" ).value.getDate(); 
add: var dayNumber = document.getElementById( "start-datetime" ).value.getDate(); 
context: function updateAdvancedRepeatDayOfMonth(){   //get the day number for today.   var dayNumber = document.getElementById( "start-date-picker" ).value.getDate();      var dayExtension = getDayExtension( dayNumber );   var weekNumber = getWeekNumberOfMonth();      var calStrings = document.getElementById("bundle_calendar");   var weekNumberText = getWeekNumberText( weekNumber );   var dayOfWeekText = getDayOfWeek( dayNumber );   var ofTheMonthText = document.getElementById( "ofthemonth-text" ).getAttribute( "value" );   var lastText = document.getElementById( "last-text" ).getAttribute( "value" );   var onTheText = document.getElementById( "onthe-text" ).getAttribute( "value" );   var dayNumberWithOrdinal = dayNumber + dayExtension;   var repeatSentence = calStrings.getFormattedString( "weekDayMonthLabel", [onTheText, dayNumberWithOrdinal, ofTheMonthText] );   document.getElementById( "advanced-repeat-dayofmonth" ).setAttribute( "label", repeatSentence );      if( weekNumber == 4 && isLastDayOfWeekOfMonth() )   {      document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );      document.getElementById( "advanced-repeat-dayofweek-last" ).removeAttribute( "collapsed" );      document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [lastText, dayOfWeekText, ofTheMonthText] ) );   }   else if( weekNumber == 4 && !isLastDayOfWeekOfMonth() )   {      document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );      document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "collapsed", "true" );   }   else   {      document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );      document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "collapsed", "true" );   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ad0f266172dd7cb61d69f9a042d490c6938ac694/toDoDialog.js/buggy/calendar/resources/content/toDoDialog.js