Page History
Cache | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
dateFormat(date, format)Format a date object to a text representation.
This will format with the system timezone, so for web and ng clients it will use the server timezone to format
see #dateFormat(Date,String,String) for using the actual clients timezone.
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'.
Symbols meaning is:
G era designator
y year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11) Parameters Returns Supported Clients Sample dateFormat(date, format, timezone)Format a date object to a text representation using the format and timezone given.
If the timezone is not given the timezone of the client itself will be used.
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'
Symbols meaning is:
G era designator
y year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11) Parameters Returns Supported Clients Sample getUnicodeCharacter(unicodeCharacterNumber)Returns a string containing the character for the unicode number. Parameters Returns Supported Clients 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 Returns Supported Clients 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 Supported Clients Sample isMondayFirstDayOfWeek()Returns true when Monday is the first day of the week for your current locale setting. Returns Supported Clients Sample numberFormat(number, digits)Format a number to have a defined fraction. Parameters Returns Supported Clients Sample numberFormat(number, format)Format a number to specification. Parameters Returns Supported Clients Sample parseDate(date, format)Parse a string to a date object.
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 Supported Clients Sample stringEscapeMarkup(textString)Returns the escaped markup text (HTML/XML). Parameters Returns Supported Clients Sample stringEscapeMarkup(textString, escapeSpaces)Returns the escaped markup text (HTML/XML). Parameters Returns Supported Clients Sample stringEscapeMarkup(textString, escapeSpaces, convertToHtmlUnicodeEscapes)Returns the escaped markup text (HTML/XML). Parameters Returns Supported Clients Sample stringFormat(text_to_format, parameters)Formats a string according to format specifiers and arguments. Parameters Returns Supported Clients Sample stringIndexReplace(text, i_start, i_size, replacement_text)Replaces a portion of a string with replacement text from a specified index. Parameters Returns Supported Clients Sample stringInitCap(text)Returns all words starting with capital chars. Parameters Returns Supported Clients Sample stringLeft(text, i_size)Returns a string with the requested number of characters, starting from the left. Parameters Returns Supported Clients Sample stringLeftWords(text, numberof_words)Returns the number of words, starting from the left. Parameters Returns Supported Clients Sample stringMD5HashBase16(textString)Returns the md5 hash (encoded as base16) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5 Parameters Returns Supported Clients Sample stringMD5HashBase64(textString)Returns the md5 hash (encoded as base64) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5 Parameters Returns Supported Clients Sample stringMiddle(text, i_start, i_size)Returns a substring from the original string. Parameters Returns Supported Clients Sample stringMiddleWords(text, i_start, numberof_words)Returns a substring from the original string. Parameters Returns Supported Clients Sample stringPBKDF2Hash(textString)Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security.
It uses a default of 9999 iterations. The string that is returned can only be used in the utils.validatePBKDF2Hash(password,thisReturnValue)
to check if this hash is a result of that password.
This will always be false: utils.stringPBKDF2Hash("test") == utils.stringPBKDF2Hash("test"). Because for the same string in multiply calls it will not generate the same hash.
So you can only check it like this: utils.validatePBKDF2Hash("test",utils.stringPBKDF2Hash("test"))
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 Parameters Returns Supported Clients Sample stringPBKDF2Hash(textString, iterations)Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security.
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 Parameters Returns Supported Clients Sample stringPatternCount(text, toSearchFor)Returns the number of times searchString appears in textString. Parameters Returns Supported Clients Sample stringPosition(textString, toSearchFor, i_start, i_occurrence)Returns the position of the string to search for, from a certain start position and occurrence. Parameters Returns Supported Clients Sample stringReplace(text, search_text, replacement_text)Replaces a portion of a string with replacement text. Parameters Returns Supported Clients Sample stringReplaceTags(text, scriptable)Returns the text with %%tags%% replaced, based on provided record or foundset or form. Parameters Returns Supported Clients Sample stringRight(text, i_size)Returns a string with the requested number of characters, starting from the right. Parameters Returns Supported Clients Sample stringRightWords(text, numberof_words)Returns the number of words, starting from the right. Parameters Returns Supported Clients Sample stringToNumber(textString)Filters characters out of from a string and leaves digits, returns the number. Uses locale decimal separator. Parameters Returns Supported Clients Sample stringToNumber(textString, decimalSeparator)Filters characters out of from a string and leaves digits, returns the number. Decimal separator is specified as parameter. Parameters Returns Supported Clients Sample stringTrim(textString)Returns the string without leading or trailing spaces. Parameters Returns Supported Clients Sample stringWordCount(text)Returns the number of words in the text string. Parameters Returns Supported Clients Sample timestampToDate(date)Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0). Parameters Returns Supported Clients Sample validatePBKDF2Hash(password, hash)Validates the given password against the given hash. The hash should be generated by one of the stringPBKDF2Hash(password [,iteration]) functions. If hash is null or empty string the method will return false.
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 Parameters Returns Supported Clients Sample |