| 123456789101112131415161718192021222324252627282930 |
- package com.imt.intimamedia.helpers
- {
- import mx.formatters.DateFormatter;
-
- public class AMFDateConverter
- {
- public function AMFDateConverter()
- {
- }
-
- public static function convert( value : * ) : Date
- {
- if( value is Date )
- {
- return value;
- }
-
- var array : Array = value.split( "-" );
-
- if( array.length == 3 )
- {
- var date : Date = new Date( array[0], array[1] - 1, array[2] );
- date.setHours( 12,0,0,0);
- return date;
- } else {
- return null;
- }
- }
- }
- }
|