[flexcoders] Re: date formating

2007-01-31 Thread Roger Ross
Thank you Brian, that worked.

starting to understand this stuff a litte more each day...


--- In flexcoders@yahoogroups.com, Brian Holmes [EMAIL PROTECTED] wrote:

 Roger,
  Use the following function.
 
 
 
   public function
 gridDateFormatter(item:Object,column:DataGridColumn):String 
   {   
   var f:DateFormatter = new DateFormatter();
   f.formatString = DD-MMM-; 
   return f.format(item[column.dataField]);
   } 
 
 
 
 Then on your grid column set the labelfucntion like:
 
 mx:DataGridColumn dataField=date headerText=Dated
 labelFunction=gridDateFormatter /
 
 
 
 Change the format string to match the format you need.
 
 
 B.
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Roger Ross
 Sent: Wednesday, January 31, 2007 2:30 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] date formating
 
 Hello,
 
 I have a date field in a grid.
 what is the correct syntax to get it to display MM/DD/ right now it
 displays as Wed Jan 30 00:00:00 GMT
 
 I have mx:DateFormatter id=df  formatString=MM/DD// as my date
 format and I added the syntax to the datafield
 dataField={df.format(entrydate)}
 
 But this just gives me an error.
 
 I found how to do it on a label but I need it formated in a grid
 column..
 
 Thank you 
 
 Roger
 
 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.com
 Yahoo! Groups Links
 
 
 
 
 
 ***
 The information in this e-mail is confidential and intended solely
for the individual or entity to whom it is addressed.  If you have
received this e-mail in error please notify the sender by return
e-mail delete this e-mail and refrain from any disclosure or action
based on the information.
 ***





[flexcoders] Re: Date formating application wide

2005-05-13 Thread joao_m_fernandes
Well I know that I can subclass standard components but I was
wondering if there was a way to do it with Flex classes.

I was wondering if there was a way for Flex to use system locals/user
locals/Default and all flex classes that depends on localization would
inherit it by default.

João Fernandes


--- In flexcoders@yahoogroups.com, Abdul Qabiz [EMAIL PROTECTED] wrote:
 You can achieve this, if it's not already there. You can subclass
DateField
 and DateChooser component and add this functionality.
 
 Following is quick and dirty example to :
 
 
 ##ExtendedDateFieldExample.mxml##
 
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml;
 xmlns:local=*
   local:DateFieldEx /
 /mx:Application
 
 
 ##DateFieldEx.as##
 
 import mx.controls.DateField;
 
 class DateFieldEx extends DateField
 {
 //default German month names...
 private static var defaultMonthNames =

[Januar,Februar,März,April,Mai,Juni,Juli,August,September,
 Oktober,November,Dezember]
 
 public function init():Void
 {
 super.init();
 monthNames = defaultMonthNames;
 }
 }
 
 
 
 
 On similar lines you can think...
 
 Hope that helps..
 
 -abdul
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of joao_m_fernandes
 Sent: Friday, May 13, 2005 5:24 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Date formating application wide
 
 Hi there,
 
 Is there a way to set default values other than English formating so
 each component uses it instead of setting formatters everywhere.
 
 Example, If I have several DateFields and DateChoosers I want to be
 able just to set in the main Application weekday names (or month
 names) and those components use it as default.
 
 If I set mx:DateField automaticly it should use my definitions of
 dayNames and monthNames without setting it directly in the component.
 
 Any Idea how I can achieve this?
 
 Thanks,
 
 João Fernandes
 
 
 
 
  
 Yahoo! Groups Links




 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/