Utils
(utils)
Methods Summarized
Methods Detailed
base64ToBytes(base64String:)
Return the byte array representation of the Base64 value
Parameters
Object base64String: the Base64 encoded string to convert to byte array
Returns: Array byteArray representation of the base64 string using UTF-8 charset for conversion
Sample
base64ToString(base64String:)
Return the String representation of the Base64 value
Parameters
Object base64String: the Base64 value to convert to String
Returns: String String decoded representation of the Base64 value using UTF-8 charset for conversion
Sample
bytesToBase64(byteArray:)
Return the Base64 value representation of the byteArray
Parameters
Object byteArray: the byte array to convert to Base64 value
Returns: String Base64 representation of the byte array using UTF-8 charset for conversion
Sample
bytesToHex(bytearray)
Parameters
Array bytearray the byte array to convert to hex encoded string
Returns: String returns hex encoded string from bytearray
Sample
bytesToString(byteArray:)
Return the string conversion of the byteArray
Parameters
Object byteArray: the byte array to convert to
Returns: String string representation of the byte array using UTF-8 charset for conversion
Sample
dateFormat(date, format)
Parameters
Returns: String the date as text
Sample
dateFormat(date, format, timezone)
Parameters
Date date the date
String format the format to output
String timezone The timezone string to use to parse the date (like GMT+3), if null then the timezone of the current client is used.
Returns: String the date as text
Sample
dateFormat(date, format, language, country)
Parameters
Date date the date
String format the format to output
String language language used to create locale
String country country used along side language to create the locale
Returns: String the date as text
Sample
dateFormat(date, format, timezone, language, country)
Parameters
Date date the date
String format the format to output
String timezone the timezone to use the format, if null then current client timezone is used.
String language language used to create locale
String country country used along side language to create the locale
Returns: String the date as text
Sample
getUnicodeCharacter(unicodeCharacterNumber)
Returns a string containing the character for the unicode number.
Parameters
Number unicodeCharacterNumber the number indicating the unicode character
Returns: String a string containing the unicode character
Sample
hasRecords(foundset)
Returns true if the (related)foundset exists and has records. Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Parameters
JSFoundSet foundset the foundset to be tested
Returns: Boolean true if exists
Sample
hasRecords(record, relationString)
Returns true if the (related)foundset exists and has records. Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Parameters
Returns: Boolean true if the foundset/relation has records.
Sample
hexToBytes(hex)
Parameters
String hex hex encoded string to be decoded into a byte array.
Returns: Array a byte array from hex encoded string
Sample
hexToString(hex)
Parameters
String hex ;
Returns: String returns decoded string from hex
Sample
isMondayFirstDayOfWeek()
Returns true when Monday is the first day of the week for your current locale setting.
Returns: Boolean true if Monday is first day of the week in current locale
Sample
numberFormat(number, digits)
Format a number to have a defined fraction.
Parameters
Returns: String the resulting number in text
Sample
numberFormat(number, digits, language, country)
Format a number to have a defined fraction.
Parameters
Number number the number to format
Number digits nr of digits
String language language used to create locale
String country country used along side language to create the locale
Returns: String the resulting number in text
Sample
numberFormat(number, format)
Format a number to specification.
Parameters
Returns: String the resulting number in text
Sample
numberFormat(number, format, language, country)
Format a number to specification.
Parameters
Number number the number to format
String format the format
String language language used to create locale
String country country used along side language to create the locale
Returns: String the resulting number in text
Sample
parseDate(date, format)
Parse a string to a date object. This parses the date using the TimeZone of the server Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Parameters
Returns: Date the date as date object
Sample
parseDate(date, format, timezone)
Parse a string to a date object. Using the timezone that is given, if null then it formats it with the clients timezone.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Parameters
String date the date as text
String format the format to parse the date
String timezone The timezone string to use to parse the date (like GMT+3)
Returns: Date the date as date object
Sample
parseDate(date, format, language, country)
Parse a string to a date object. Using language and country that are given, if null then it formats it with the locale of the client
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Parameters
String date the date as text
String format the format to parse the date
String language language used to create locale
String country country used along side language to create the locale
Returns: Date the date as date object
Sample
parseDate(date, format, timezone, language, country)
Parse a string to a date object. Using the timezone, language and country that are given, if null then it formats it with the timezone and locale of the client
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Parameters
String date the date as text
String format the format to parse the date
String timezone The timezone string to use to parse the date (like GMT+3)
String language language used to create locale
String country country used along side language to create the locale
Returns: Date the date as date object
Sample
stringEscapeMarkup(textString)
Returns the escaped markup text (HTML/XML).
Parameters
String textString the text to process
Returns: String the escaped text
Sample
stringEscapeMarkup(textString, escapeSpaces)
Returns the escaped markup text (HTML/XML).
Parameters
Returns: String the escaped text
Sample
stringEscapeMarkup(textString, escapeSpaces, convertToHtmlUnicodeEscapes)
Returns the escaped markup text (HTML/XML).
Parameters
String textString the text to process
Boolean escapeSpaces indicating to escape spaces
Boolean convertToHtmlUnicodeEscapes indicating to use unicode escapes
Returns: String the escaped text
Sample
stringFormat(text_to_format, parameters)
Formats a string according to format specifiers and arguments.
Parameters
Returns: String the formatted text
Sample