Packagecom.pronto.lib
Classpublic class Utils

Class for utilitary static methods.



Public Methods
 MethodDefined by
  
adoptHTMLToTextField(html:String, stripImage:Boolean = false, createXHTML:Boolean = false):String
[static] Try to process any HTML to TextField.htmlText-valid format.
Utils
  
dateFromString(string:String):Date
[static] Parses date from "20090404T015200" or "20090403T215200Z" to Date.
Utils
  
dateToString(date:Date):String
[static] Converts date to string, ex.
Utils
  
formatBytes(bytes:Number):String
[static] Formats bytes to string, ex.
Utils
  
formatDate(date:Date, templateId:String = null, template:String = null):String
[static] Converts Date to String according to the given template.
Utils
  
getDate(type:String = null):*
[static] Returns Date or String object.
Utils
  
[static] Returns user preferences timezone offset in seconds.
Utils
Method detail
adoptHTMLToTextField()method
public static function adoptHTMLToTextField(html:String, stripImage:Boolean = false, createXHTML:Boolean = false):String

Try to process any HTML to TextField.htmlText-valid format.

Parameters
html:String
 
stripImage:Boolean (default = false)
 
createXHTML:Boolean (default = false)

Returns
String

See also

flash.text.TextField.htmlText
dateFromString()method 
public static function dateFromString(string:String):Date

Parses date from "20090404T015200" or "20090403T215200Z" to Date.

Parameters
string:String

Returns
Date
dateToString()method 
public static function dateToString(date:Date):String

Converts date to string, ex. "20090720T111918".

Parameters
date:Date

Returns
String
formatBytes()method 
public static function formatBytes(bytes:Number):String

Formats bytes to string, ex. "24 Kb".

Parameters
bytes:Number — Number of bytes.

Returns
String — Resulting string.
formatDate()method 
public static function formatDate(date:Date, templateId:String = null, template:String = null):String

Converts Date to String according to the given template. If no template was given, it is selected automatically.

Parameters
date:Date — Target date.
 
templateId:String (default = null) — Id from server strings, ex. "DatePictures.timeOnly".
 
template:String (default = null) — Template itself, ex. "^h:^m:^s^t".

Returns
String — Formatted date.
getDate()method 
public static function getDate(type:String = null):*

Returns Date or String object.

Parameters
type:String (default = null) — Possible values are "localString", "local", "utcString".

Returns
*
timezoneOffset()method 
public static function timezoneOffset():int

Returns user preferences timezone offset in seconds.

Returns
int — Positive or negative number of seconds.