The Flex Show - Creating Flex Components - Episode 10: Layout Logic Part 4
This is the tenth episode of our video series on creating Flex Components. This is a series of screencasts designed to teach you how to build a component in Flex, starting from nothing and moving up to a finished component.
In this episode we tackle the updateDisplayList() method in our CalendarDisplay class.
You can View it online right here.
Sponsored By
Register and Download our No Cost Developer Editions today
Links
- View the Episode Online (Opens in New Window)
- Documentation on implementing Component LifeCycle
I downloaded the version 1.0.7 of Utilities pack, but I can't find the method
/**
* Calculates the number of the days in the first week of the given month
*
* @param date A day in the month we want to find out how many days it has
* @param firstDayOfWeek The first day of the week, 0 (Sunday) - 6 ( Saturday ); 0 is the default.
* Will probably be used primarily for localization purposes
*
* @return The number of days in the first week of the month, taking into account the first day of the week
*
*/
public static function daysInFirstWeekOfMonth(date : Date, firstDayOfWeek : int = 0):Number{
var result : Number = 1;
result = 7 - (DateUtils.dayOfWeek(date) - firstDayOfWeek);
if(result >7 ){
result = result - 7;
}
return result;
}