Hi Also posting the code here. If in future the link posted previous becomes 
void.

Got some help from http://forums.adobe.com/thread/187143 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" 
creationComplete="init()" width="934" height="82" 
backgroundColor="0x000000">
<mx:Style>
TextArea
{
text-field-width:25; 
}

VBox
{
vertical-gap:0;
horizontal-gap:0;
 }
.labelDaysNames
{ 
background-color:#CCCCCC; 
color:#000000;

border-style:none;
border-thickness:0;
border-thickness-bottom:0;
border-thickness-left:0;
border-thickness-top:0;
border-thickness-right:0;
 borderStyle: solid;
   borderThickness: 0;
cornerRadius: 0;
dropShadowColor: #CCCCCC;


text-align:center;
vertical-align:middle;
font-size:10;
}

.labelDays
{ 
color:#cccccc;
background-color:#444444;
 border-style:solid;
border-thickness:1;
border-thickness-bottom:0;
border-thickness-left:0;
border-thickness-top:0;
border-thickness-right:1;
text-align:center;
vertical-align:middle;
 cornerRadius: 6;
font-size:11;

 } 
 .selectedLabelDays
{ 
color:#cccccc;
background-color:#000000;
 border-style:solid;
border-thickness:1;
border-thickness-bottom:0;
border-thickness-left:0;
border-thickness-top:0;
border-thickness-right:1;
text-align:center;
vertical-align:middle;
 cornerRadius: 6;
font-size:12; 
} 

.selectedLabelDaysNames
{ 
background-color:#FFFFFF; 
color:#000000;

border-style:none;
border-thickness:0;
border-thickness-bottom:0;
border-thickness-left:0;
border-thickness-top:0;
border-thickness-right:0;
 borderStyle: solid;
   borderThickness: 0;
cornerRadius: 6;
dropShadowColor: #CCCCCC;


text-align:center;
vertical-align:middle;
} 
</mx:Style>
<mx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
import mx.utils.ObjectProxy;
import mx.controls.TextArea;
import mx.containers.VBox;
import mx.containers.HBox;
import mx.controls.Label;
import mx.messaging.channels.StreamingAMFChannel;
import mx.formatters.DateFormatter;
import mx.formatters.Formatter;
import mx.controls.Alert;
  [Bindable]
public var currentMonth:Number;
public var currentMonth2:String;
public var currentDay:Number;
public var currentDate:Number;
public var currentDate2:String;
public var currentYear:Number;
 public var d:Date;
public var iDay:int;
public var now:Date = new Date();
public var d3:Date 
 private function init():void
{
 currentDay = now.day; 
currentDate = now.date; 
currentMonth = now.month; 
currentYear = now.fullYear;
getNumberOfDaysInAMonth(currentMonth);
  }
private function getNumberOfDaysInAMonth(iOneBasedMonthNumber:int):void 
{  
//since months are really zero-based, this is asking for March, 0 
//but out of range days go forward or back, so March "0" returns the last 
day in February 
 d = new Date(currentYear,currentMonth+1,0); 
iDay = d.getDate(); //this returns the day number of that last day

 var formatter:DateFormatter = new DateFormatter(); 
formatter.formatString = "D";  
 //currentDate2 = new String(formatter.format(d));
 var formatter2:DateFormatter = new DateFormatter()
formatter2.formatString = "EEE" 
 //currentMonth2 = new String(formatter2.format(d));

 //Alert.show(d.toString());  // full date view 
//Alert.show(currentMonth2); // Mon, Tue ,Wed
//Alert.show(currentMonth.toString()); // Month in number from  0  to 11
//Alert.show(currentDate2); // Jan,Feb
//Alert.show(currentDate.toString()); // Today 
//Alert.show(currentDay.toString()); // current day in numbers 0,1,2,3,4,5,6
//Alert.show(iDay.toString()); // Total no of days say 31, 30, 28 or 29 
 for (var i:int = 0 ; i < iDay;i++ )
{
d3 = new Date(currentYear,currentMonth,i+1);
currentDate2 = new String(formatter.format(d3)); 
currentMonth2 = new String(formatter2.format(d3));
 var vbox: VBox = new VBox();
vbox.id = "vbox" + i
 var llabel: TextArea = new TextArea;
var llabel2: TextArea = new TextArea;
 llabel.text = currentDate2;
llabel2.text = currentMonth2;  
 llabel.height =26;
llabel.styleName ="labelDays";
llabel.width = 30;

llabel2.height = 30;
llabel2.styleName = "labelDaysNames"
llabel2.width = 30;
 if ( ObjectUtil.dateCompare(d,d3) == 0)
{
llabel.styleName = "selectedLabelDays"
llabel2.styleName = "selectedLabelDaysNames";
}
 vbox.addChild(llabel2);
vbox.addChild(llabel);
 daystxt.addChild(vbox) 
}
 }//getNumberOfDaysInAMonth 
]]>
</mx:Script>

<mx:Tile id="daystxt" backgroundColor="0x000000" height="65" width="100%" 
direction="horizontal" paddingLeft="0" paddingRight="0" horizontalGap="0" 
verticalGap="0" bottom="0">
 </mx:Tile>
 </mx:Application>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to