                     return;
             }
     
-            else if (event.keyCode == Keyboard.RIGHT)
+            else if (keyCode == Keyboard.RIGHT)
             {
                 if (date < daysInMonth)
                 {

            }
    
            else if (lastSelectedDate && event.shiftKey &&
                     (event.keyCode == Keyboard.PAGE_UP ||
                      event.keyCode == Keyboard.PAGE_DOWN))
            {
                selChanged = true;
            }
            
            else if (lastSelectedDate &&
                     (event.keyCode == 189 ||
                      event.keyCode == 187)) // for year - and +
            {
                selChanged = true;
            }
    
            if (event.keyCode >= Keyboard.PAGE_UP &&
                event.keyCode <= Keyboard.DOWN)
            {
                event.stopPropagation();
            }


        var daysInMonth:int = getNumberOfDaysInMonth(displayedYear, displayedMonth);

        // If rtl layout, need to swap LEFT for RIGHT so correct action
        // is done.
        var keyCode:int = mapKeycodeForLayoutDirection(event);
                
        for (var i:uint = 0; i < 31; i++)
        {
            if (keyCode == Keyboard.LEFT)
            {
                if (date > 1)
                {
