You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2017/11/01 23:20:46 UTC

[GitHub] Harbs closed pull request #54: Date chooser performance

Harbs closed pull request #54: Date chooser performance
URL: https://github.com/apache/royale-asjs/pull/54
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/DateChooserModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/DateChooserModel.as
index ab3e91943..ae0fe3e05 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/DateChooserModel.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/DateChooserModel.as
@@ -220,27 +220,28 @@ package org.apache.royale.html.beads.models
          */
         private function updateCalendar():void
         {       
-            var firstDay:Date = new Date(displayedYear,displayedMonth,1);
-            
-            _days = new Array(42);
-            
-            // blank out the labels for the first firstDay.day-1 entries.
-            for(var i:int=0; i < firstDay.getDay(); i++) {
-                _days[i] = null;
-            }
-            
-            // renumber to the last day of the month
-            var dayNumber:int = 1;
-            var numDays:Number = numberOfDaysInMonth(displayedMonth, displayedYear);
-            
-            for(; i < _days.length && dayNumber <= numDays; i++) {
-                _days[i] = new Date(displayedYear, displayedMonth, dayNumber++);
-            }
-            
-            // blank out the rest
-            for(; i < _days.length; i++) {
-                _days[i] = null;
-            }
+			var firstDay:Date = new Date(displayedYear,displayedMonth,1);
+			var startMonth:int = firstDay.getDay();
+			_days = new Array(42);
+			var maxDays:int = _days.length;
+
+			// blank out the labels before the 1st of the month
+			for(var i:int=0; i < startMonth; i++) {
+			   _days[i] = null;
+			}
+
+			// renumber to the last day of the month
+			var dayNumber:int = 1;
+			var numDays:Number = numberOfDaysInMonth(displayedMonth, displayedYear);
+
+			for(; i < maxDays && dayNumber <= numDays; i++) {
+			   _days[i] = new Date(displayedYear, displayedMonth, dayNumber++);
+			}
+
+			// blank out the rest
+			for(; i < maxDays; i++) {
+			   _days[i] = null;
+		   }
         }
         
         /**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services