types.js | |
ng_SIUnits | Definitions of SI units. |
ng_DecimalSeparator | Gets decimal separator according to current application language. |
ng_decodeSIUnits | Decodes given units to units with exponent (square, quadratic). |
ng_CompareSIUnits | Compares two decoded units. |
ng_StripSIUnits | Strips units from given string. |
ng_getSIUnits | Gets SI units definition from given string with units. |
Type validation functions | |
ng_typeString | Tests if type of given variable is a string. |
ng_typeNumber | Tests if type of given variable is a number. |
ng_typeNumberInt | Tests if type of given variable is an integer number. |
ng_typeNumberFloat | Tests if type of given variable is a float number. |
ng_typeDate | Tests if type of given variable is a date object. |
ng_typeObject | Tests if type of given variable is a valid object. |
ng_typeArray | Tests if type of given variable is an indexed array. |
Value validation functions | |
ng_isEmpty | Tests if given variable is undefined. |
ng_isNull | Tests if given variable is Null. |
ng_isEmptyOrNull | Tests if given variable is undefined or Null. |
ng_isInvalid | Tests if given variable has invalid value according its type. |
ng_isNumber | Tests if given variable is, or can be lossless converted to, a number. |
ng_isInteger | Tests if given variable is, or can be lossless converted to, an integer number. |
ng_isFloat | Tests if given variable is, or can be lossless converted to, a float number. |
ng_isSByte | Tests if given variable is, or can be lossless converted to, a signed byte. |
ng_isByte | Tests if given variable is, or can be lossless converted to, a byte. |
ng_isShort | Tests if given variable is, or can be lossless converted to, a short. |
ng_isUShort | Tests if given variable is, or can be lossless converted to, a unsigned short. |
ng_isLong | Tests if given variable is, or can be lossless converted to, a long. |
ng_isULong | Tests if given variable is, or can be lossless converted to, a unsigned long. |
ng_isDate | Tests if given variable is, or can be lossless converted to, a date object. |
ng_isNVARCHAR | Tests if given variable is, or can be lossless converted to, a NVARCHAR. |
ng_isDECIMAL | Tests if given variable is, or can be lossless converted to, a DECIMAL. |
ng_isDateISO8601 | Tests if given variable is, or can be lossless converted from, date string in ISO 8601 format. |
ng_isSIUnits | Tests if given variable is, or can be lossless converted from, string with SI units. |
ng_isDistance | Tests if given variable represents, or can be lossless converted to, a distance. |
ng_isArea | Tests if given variable represents, or can be lossless converted to, an area. |
ng_isSeconds | Tests if given variable represents, or can be lossless converted to, seconds. |
ng_isMinutes | Tests if given variable represents, or can be lossless converted to, minutes. |
ng_isHex | Tests if given variable represents hexadecimal numbers. |
ng_isDigits | Tests if value of given variable contains only digits. |
ng_isEmail | Tests if value of given variable is e-mail. |
ng_isURL | Tests if value of given variable is URL. |
ng_isWWW | Tests if value of given variable is web address. |
ng_isIP4 | Tests if value of given variable is IP4 address. |
ng_isIP6 | Tests if value of given variable is IP6 address. |
ng_isUnicode | Tests if value of given variable is unicode string. |
ng_isASCII | Tests if value of given variable is ASCII string. |
Conversions functions | |
ng_toBool | Converts given variable to boolean. |
ng_toString | Converts given variable to string. |
ng_toObject | Converts given variable to object. |
ng_toNumber | Converts given variable to number. |
ng_toSByte | Converts given variable to signed byte. |
ng_toByte | Converts given variable to byte. |
ng_toShort | Converts given variable to short. |
ng_toUShort | Converts given variable to unsigned short. |
ng_toLong | Converts given variable to long. |
ng_toULong | Converts given variable to unsigned long. |
ng_toInteger | Converts given variable to integer number. |
ng_toFloat | Converts given variable to float number. |
ng_toDate | Converts given variable to date object. |
ng_toDateOnly | Converts given variable to date object . |
ng_toNVARCHAR | Converts given variable to NVARCHAR. |
ng_toDECIMAL | Converts given variable to DECIMAL. |
ng_toUTCDate | Converts given variable to UTC date. |
ng_fromUTCDate | Converts given variable from UTC date. |
ng_toUnixTimestamp | Converts given variable to UNIX timestamp. |
ng_fromUnixTimestamp | Converts UNIX timestamp to date. |
ng_formatDateISO8601 | Converts given variable to date string in ISO 8601 format. |
ng_parseDateISO8601 | Converts given variable from date string in ISO 8601 format to date. |
ng_parseSIUnits | Converts given variable from string with SI units to number. |
ng_formatSIUnits | Converts given variable to string followed by SI units. |
ng_parseBytes | Converts given variable from bytes with units to number. |
ng_formatBytes | Converts given variable to distance with units. |
ng_parseDistance | Converts given variable from distance with units to number. |
ng_formatDistance | Converts given variable to distance with units. |
ng_parseArea | Converts given variable from area with units to number. |
ng_formatArea | Converts given variable to area with units. |
ng_parseSeconds | Converts given variable from string time to number of seconds. |
ng_formatSeconds | Converts given variable from number of seconds to string time. |
ng_parseMinutes | Converts given variable from string time to number of minutes. |
ng_formatMinutes | Converts given variable from number of minutes to string time. |
ng_formatWWW | Converts given variable to web address. |
ng_toASCII | Converts given variable to ASCII string. |
ng_toNonUnicode | Converts given variable to non-unicode string. |
ng_toHex | Converts given variable to hexadecimal. |
ng_Hex2Str | Decodes hexadecimal encoded string. |
Array functions | |
ng_idxInArray | Finds given value in indexed array. |
ng_inArray | Tests if given value is in indexed array. |
DateTime functions | |
ng_DefaultDateFormat | Gets default date format according to selected language. |
ng_DefaultTimeFormat | Gets default time format according to selected language. |
ng_DefaultDateTimeFormat | Gets default date and time format according to selected language. |
ng_DateFormat | Gets default date format function. |
ng_TimeFormat | Gets default time format function. |
ng_DateTimeFormat | Gets default date and time format function. |
ng_ExtractDate | Extracts date part from datetime variable. |
ng_LeapYear | Detects if year is a leap year. |
ng_DaysInMonth | Determines number of days in month. |
ng_FormatTime | Formats time to string. |
ng_FormatDate | Formats date to string. |
ng_FormatDateTime | Formats date and time to string. |
ng_ParseTime | Parses time from string. |
ng_ParseDate | Parses date from string. |
ng_ParseDateTime | Parses date and time from string. |
ng_ParseJSONDateTime | Parses date string formated by JSON encoder. |
ng_GetDateFormat | Tries to figure out the date format from given text date. |
String functions | |
ng_Trim | Trims leading and trailing spaces. |
ng_LTrim | Trims leading spaces. |
ng_RTrim | Trims trailing spaces. |
ng_StripPrefix | Strips given prefix from a string. |
ng_StripSuffix | Strips given suffix from a string. |
ng_AddPrefix | Adds given prefix to a string (if not already present). |
ng_AddSuffix | Adds given suffix to a string (if not already present). |
ng_AddSlash | Adds slash ‘/’ to end of a string (if not already present). |
ng_StripSlash | Strips slash ‘/’ from end of a string. |
ng_AddBackslash | Adds backslash ‘\’ to end of a string (if not already present). |
ng_StripBackslash | Strips backslash ‘\’ from end of a string. |
ng_StripQuotes | Strips quotes from quoted string. |
ng_QuoteStr | Adds quotes to string. |
ng_Unformat3Num | Removes thousands separator from string. |
ng_Format3Num | Adds thousands separator to string. |
function ng_getSIUnits( v, units, def )
Gets SI units definition from given string with units.
string ng_getSIUnits (string v, string units[, mixed def=null])
v | string with units |
units | dimension units |
def | default value, used if SI units definition not founds |
SI units definition or default value if not found.
function ng_isDate( v, format )
Tests if given variable is, or can be lossless converted to, a date object.
bool ng_isDate (mixed var [, string format])
var | variable to test |
format | optional date and time format string, use default if not specified |
TRUE if variable can be date object
function ng_isDECIMAL( v, digits, frac_digits )
Tests if given variable is, or can be lossless converted to, a DECIMAL.
bool ng_isDECIMAL (mixed var, int digits, int frac_digits)
var | variable to test |
digits | total number of digits |
frac_digits | number of digits in fraction part of number |
TRUE if variable can be DECIMAL
function ng_isSIUnits( v, units, allowedpref )
Tests if given variable is, or can be lossless converted from, string with SI units.
bool ng_isSIUnits (mixed var, string units [, mixed allowedpref])
var | variable to test |
units | dimension units |
allowedpref | optional list of allowed SI prefixes |
TRUE if variable can be a string with SI units
function ng_toDate( v, def, format )
Converts given variable to date object.
mixed ng_toDate (mixed var [,mixed def=null, format=undefined])
var | variable to convert |
def | default value, used if conversion fails |
format | optional parsing format |
Converted value or default value if conversion fails.
function ng_toDateOnly( v, def, format )
Converts given variable to date object .
mixed ng_toDateOnly (mixed var [,mixed def=null, format=undefined])
var | variable to convert |
def | default value, used if conversion fails |
format | optional parsing format |
Converted value or default value if conversion fails.
function ng_toNVARCHAR( v, size, def )
Converts given variable to NVARCHAR.
mixed ng_toNVARCHAR (mixed var [, int size, mixed def=’’])
var | variable to convert |
size | optional size limit |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_toDECIMAL( v, digits, frac_digits, def )
Converts given variable to DECIMAL.
mixed ng_toDECIMAL (mixed var, int digits, int frac_digits [,mixed def=NaN])
var | variable to convert |
digits | total number of digits |
frac_digits | number of digits in fraction part of number |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_formatDateISO8601( d, def )
Converts given variable to date string in ISO 8601 format.
mixed ng_formatDateISO8601 (mixed var [, mixed def=’’])
var | variable to convert |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_parseDateISO8601( s, def )
Converts given variable from date string in ISO 8601 format to date.
mixed ng_parseDateISO8601 (mixed var [, mixed def=null])
var | variable to convert |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_parseSIUnits( v, units, def, allowedpref, binary )
Converts given variable from string with SI units to number.
mixed ng_parseSIUnits (mixed var, string units [, mixed def=NaN, mixed allowedpref, bool binary=false])
var | variable to convert |
units | dimension units |
def | default value, used if conversion fails |
allowedpref | optional list of allowed SI prefixes |
binary | if TRUE, use binary exponents |
Converted value or default value if conversion fails.
function ng_formatSIUnits( v, units, def, allowedpref, precision, formatfnc, userdata, binary )
Converts given variable to string followed by SI units.
mixed ng_formatSIUnits (mixed var, string units [, mixed def=’’, mixed allowedpref, int precision, function formatfnc, mixed userdata, bool binary=false])
var | variable to convert |
units | dimension units |
def | default value, used if conversion fails |
allowedpref | optional list of allowed SI prefixes |
precision | optional required output number precision |
formatfnc | optional formating function callback |
userdata | user data passed to formating function |
binary | if TRUE, use binary exponents |
Converted value or default value if conversion fails.
mixed function (number var,object si_def, string units, mixed def, array allowedpref, mixed userdata)
Returns formated value.
function ng_formatBytes( v, def, precision, formatfnc, userdata )
Converts given variable to distance with units.
mixed ng_formatBytes (mixed var [, mixed def=’’, int precision, function formatfnc, mixed userdata])
var | variable to convert |
def | default value, used if conversion fails |
precision | optional required output number precision |
formatfnc | optional formating function callback |
userdata | user data passed to formating function |
Converted value or default value if conversion fails.
mixed function (number var,object si_def, string units, mixed def, array allowedpref, mixed userdata)
Returns formated value.
function ng_formatDistance( v, def, precision, formatfnc, userdata )
Converts given variable to distance with units.
mixed ng_formatDistance (mixed var [, mixed def=’’, int precision, function formatfnc, mixed userdata])
var | variable to convert |
def | default value, used if conversion fails |
precision | optional required output number precision |
formatfnc | optional formating function callback |
userdata | user data passed to formating function |
Converted value or default value if conversion fails.
mixed function (number var,object si_def, string units, mixed def, array allowedpref, mixed userdata)
Returns formated value.
function ng_formatArea( v, def, precision, formatfnc, userdata )
Converts given variable to area with units.
mixed ng_formatArea (mixed var [, mixed def=’’, int precision, function formatfnc, mixed userdata])
var | variable to convert |
def | default value, used if conversion fails |
precision | optional required output number precision |
formatfnc | optional formating function callback |
userdata | user data passed to formating function |
Converted value or default value if conversion fails.
mixed function (number var,object si_def, string units, mixed def, array allowedpref, mixed userdata)
Returns formated value.
function ng_formatSeconds( v, def, ms )
Converts given variable from number of seconds to string time.
mixed ng_formatSeconds (mixed var [, mixed def=’’])
var | variable to convert |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_formatMinutes( v, def, ms )
Converts given variable from number of minutes to string time.
mixed ng_formatMinutes (mixed var [, mixed def=’’])
var | variable to convert |
def | default value, used if conversion fails |
Converted value or default value if conversion fails.
function ng_idxInArray( value, arr, fromidx, toidx, cmpfnc, userdata )
Finds given value in indexed array.
int ng_idxInArray (mixed value, array arr [, int fromidx=0, int toidx=arr.length, function cmpfnc, mixed userdata])
value | value to find |
arr | array to scan |
fromidx | start scan array from this index |
toidx | end scan array if reached to this index |
cmdfnc | compare function callback |
userdata | user data passed to compare function |
Index of value in array of -1 if value not found.
bool function (v1,v2,userdata)
Returns true if v1 is equal to v2.
function ng_inArray( value, arr, fromidx, toidx, cmpfnc, userdata )
Tests if given value is in indexed array.
int ng_inArray (mixed value, array arr [, int fromidx=0, int toidx=arr.length, function cmpfnc, mixed userdata])
value | value to find |
arr | array to scan |
fromidx | start scan array from this index |
toidx | end scan array if reached to this index |
cmdfnc | compare function callback |
userdata | user data passed to compare function |
TRUE if value is present in array.
bool function (v1,v2,userdata)
Returns true if v1 is equal to v2.
function ng_DefaultDateFormat( parse, shortfmt )
Gets default date format according to selected language.
string ng_DefaultDateFormat (bool parse [, bool shortfmt=false])
parse | if TRUE, return date and time format for parsing purposes. |
shortfmt | if TRUE, return date and time short format |
Default date format.
Format strings in ng_FormatDateTime.
function ng_DefaultTimeFormat( parse, shortfmt )
Gets default time format according to selected language.
string ng_DefaultTimeFormat (bool parse [, bool shortfmt=false])
parse | if TRUE, return date and time format for parsing purposes. |
shortfmt | if TRUE, return date and time short format |
Default time format.
Format strings in ng_FormatDateTime.
function ng_DefaultDateTimeFormat( parse, shortfmt )
Gets default date and time format according to selected language.
string ng_DefaultDateTimeFormat (bool parse [, bool shortfmt=false])
parse | if TRUE, return date and time format for parsing purposes. |
shortfmt | if TRUE, return date and time short format |
Default date and time format.
Format strings in ng_FormatDateTime.
var ng_DateTimeFormat
Gets default date and time format function.
Default value: ng_DefaultDateTimeFormat
function ng_FormatTime( date, format, def )
Formats time to string.
string ng_FormatTime (date d [, string format, mixed def])
-
Formated time.
Format strings in ng_FormatDateTime.
function ng_FormatDate( date, format, def )
Formats date to string.
string ng_FormatDate (date d [, string format, mixed def])
d | date |
format | format string |
def | returned value if d is not date |
Formated date.
Format strings in ng_FormatDateTime.
function ng_FormatDateTime( date, format, def )
Formats date and time to string.
string ng_FormatDateTime (date d [, string format, mixed def])
d | date |
format | format string |
def | returned value if d is not date |
yyyy | year (4 digits) |
yy | year (2 digits) |
y | year (2 or 4 digits) |
MM | month (2 digits) |
M | month (1 or 2 digits) |
MMM | full name of month |
NNN | short name of month |
d | day of month (1 or 2 digits) |
dd | day of month (2 digits) |
E | short name of day of week |
EE | full name of day of week |
HH | hour 0-23 (2 digits) |
H | hour 0-23 (1 or 2 digits) |
hh | hour 1-12 (2 digits) |
h | hour 1-12 (1 or 2 digits) |
kk | hour 1-24 (2 digits) |
k | hour 1-24 (1 or 2 digits) |
KK | hour 0-11 (2 digits) |
K | hour 0-11 (1 or 2 digits) |
mm | minute (2 digits) |
m | minute (1 or 2 digits) |
ss | second (2 digits) |
s | second (1 or 2 digits) |
u | microsecond |
a | AM/PM |
Formated date and time.
function ng_ParseTime( date, format, def )
Parses time from string.
date ng_ParseTime (string s [, string format, mixed def])
s | string to be parsed |
format | format string |
def | returned value if d is not time |
Parsed time.
Format strings in ng_FormatDateTime.
function ng_ParseDate( date, format, def )
Parses date from string.
date ng_ParseDate (string s [, string format, mixed def])
s | string to be parsed |
format | format string |
def | returned value if d is not date |
Parsed date.
Format strings in ng_FormatDateTime.
function ng_ParseDateTime( val, format, def )
Parses date and time from string.
date ng_ParseDateTime (string s [, string format, mixed def])
s | string to be parsed |
format | format string |
def | returned value if d is not datetime |
Parsed date and time.
Format strings in ng_FormatDateTime.
function ng_GetDateFormat( val, preferEuro )
Tries to figure out the date format from given text date.
date ng_GetDateFormat (string s [, bool preferEuro=true])
-
Date format.
Format strings in ng_FormatDateTime.
function ng_StripPrefix( v, pref, caseinsensitive )
Strips given prefix from a string.
string ng_StripPrefix (string s, string prefix [, bool caseinsensitive=false])
s | string |
prefix | prefix string |
caseinsensitive | if TRUE, prefix is tested without case sensitivity |
String without prefix.
function ng_StripSuffix( v, suff, caseinsensitive )
Strips given suffix from a string.
string ng_StripSuffix (string s, string suffix [, bool caseinsensitive=false])
s | string |
suffix | suffix string |
caseinsensitive | if TRUE, suffix is tested without case sensitivity |
String without suffix.
function ng_AddPrefix( v, pref, caseinsensitive )
Adds given prefix to a string (if not already present).
string ng_AddPrefix (string s, string prefix [, bool caseinsensitive=false])
s | string |
prefix | prefix string |
caseinsensitive | if TRUE, prefix is tested without case sensitivity |
String with prefix.
function ng_AddSuffix( v, suff, caseinsensitive )
Adds given suffix to a string (if not already present).
string ng_AddSuffix (string s, string suffix [, bool caseinsensitive=false])
s | string |
suffix | suffix string |
caseinsensitive | if TRUE, suffix is tested without case sensitivity |
String with suffix.
Definitions of SI units.
var ng_SIUnits
Decodes given units to units with exponent (square, quadratic).
function ng_decodeSIUnits( units )
Compares two decoded units.
function ng_CompareSIUnits( u1, u2 )
Strips units from given string.
function ng_StripSIUnits( v, units )
Gets SI units definition from given string with units.
function ng_getSIUnits( v, units, def )
Tests if type of given variable is a string.
function ng_typeString( n )
Tests if type of given variable is a number.
function ng_typeNumber( n )
Tests if type of given variable is an integer number.
function ng_typeNumberInt( n )
Tests if type of given variable is a float number.
function ng_typeNumberFloat( n )
Tests if type of given variable is a date object.
function ng_typeDate( d )
Tests if type of given variable is a valid object.
function ng_typeObject( o )
Tests if type of given variable is an indexed array.
function ng_typeArray( v )
Tests if given variable is undefined.
function ng_isEmpty( n )
Tests if given variable is Null.
function ng_isNull( n )
Tests if given variable is undefined or Null.
function ng_isEmptyOrNull( n )
Tests if given variable has invalid value according its type.
function ng_isInvalid( n )
Tests if given variable is, or can be lossless converted to, a number.
function ng_isNumber( v )
Tests if given variable is, or can be lossless converted to, an integer number.
function ng_isInteger( v )
Tests if given variable is, or can be lossless converted to, a float number.
function ng_isFloat( v )
Tests if given variable is, or can be lossless converted to, a signed byte.
function ng_isSByte( v )
Tests if given variable is, or can be lossless converted to, a byte.
function ng_isByte( v )
Tests if given variable is, or can be lossless converted to, a short.
function ng_isShort( v )
Tests if given variable is, or can be lossless converted to, a unsigned short.
function ng_isUShort( v )
Tests if given variable is, or can be lossless converted to, a long.
function ng_isLong( v )
Tests if given variable is, or can be lossless converted to, a unsigned long.
function ng_isULong( v )
Tests if given variable is, or can be lossless converted to, a date object.
function ng_isDate( v, format )
Tests if given variable is, or can be lossless converted to, a NVARCHAR.
function ng_isNVARCHAR( v, size )
Tests if given variable is, or can be lossless converted to, a DECIMAL.
function ng_isDECIMAL( v, digits, frac_digits )
Tests if given variable is, or can be lossless converted from, date string in ISO 8601 format.
function ng_isDateISO8601( v )
Tests if given variable is, or can be lossless converted from, string with SI units.
function ng_isSIUnits( v, units, allowedpref )
Tests if given variable represents, or can be lossless converted to, a distance.
function ng_isDistance( v )
Tests if given variable represents, or can be lossless converted to, an area.
function ng_isArea( v )
Tests if given variable represents, or can be lossless converted to, seconds.
function ng_isSeconds( v )
Tests if given variable represents, or can be lossless converted to, minutes.
function ng_isMinutes( v )
Tests if given variable represents hexadecimal numbers.
function ng_isHex( s )
Tests if value of given variable contains only digits.
function ng_isDigits( s )
Tests if value of given variable is e-mail.
function ng_isEmail( s )
Tests if value of given variable is URL.
function ng_isURL( s )
Tests if value of given variable is web address.
function ng_isWWW( s )
Tests if value of given variable is IP4 address.
function ng_isIP4( s )
Tests if value of given variable is IP6 address.
function ng_isIP6( s )
Tests if value of given variable is unicode string.
function ng_isUnicode( s )
Tests if value of given variable is ASCII string.
function ng_isASCII( s )
Converts given variable to boolean.
function ng_toBool( v )
Converts given variable to string.
function ng_toString( v, def )
Converts given variable to object.
function ng_toObject( v, def )
Converts given variable to number.
function ng_toNumber( v, def )
Converts given variable to signed byte.
function ng_toSByte( v, def )
Converts given variable to byte.
function ng_toByte( v, def )
Converts given variable to short.
function ng_toShort( v, def )
Converts given variable to unsigned short.
function ng_toUShort( v, def )
Converts given variable to long.
function ng_toLong( v, def )
Converts given variable to unsigned long.
function ng_toULong( v, def )
Converts given variable to integer number.
function ng_toInteger( v, def )
Converts given variable to float number.
function ng_toFloat( v, def )
Converts given variable to date object.
function ng_toDate( v, def, format )
Converts given variable to date object .
function ng_toDateOnly( v, def, format )
Converts given variable to NVARCHAR.
function ng_toNVARCHAR( v, size, def )
Converts given variable to DECIMAL.
function ng_toDECIMAL( v, digits, frac_digits, def )
Converts given variable to UTC date.
function ng_toUTCDate( d, def )
Converts given variable from UTC date.
function ng_fromUTCDate( d, def )
Converts given variable to UNIX timestamp.
function ng_toUnixTimestamp( d, def )
Converts UNIX timestamp to date.
function ng_fromUnixTimestamp( d, def )
Converts given variable to date string in ISO 8601 format.
function ng_formatDateISO8601( d, def )
Converts given variable from date string in ISO 8601 format to date.
function ng_parseDateISO8601( s, def )
Converts given variable from string with SI units to number.
function ng_parseSIUnits( v, units, def, allowedpref, binary )
Converts given variable to string followed by SI units.
function ng_formatSIUnits( v, units, def, allowedpref, precision, formatfnc, userdata, binary )
Converts given variable from bytes with units to number.
function ng_parseBytes( v, def )
Converts given variable to distance with units.
function ng_formatBytes( v, def, precision, formatfnc, userdata )
Converts given variable from distance with units to number.
function ng_parseDistance( v, def )
Converts given variable to distance with units.
function ng_formatDistance( v, def, precision, formatfnc, userdata )
Converts given variable from area with units to number.
function ng_parseArea( v, def )
Converts given variable to area with units.
function ng_formatArea( v, def, precision, formatfnc, userdata )
Converts given variable from string time to number of seconds.
function ng_parseSeconds( v, def )
Converts given variable from number of seconds to string time.
function ng_formatSeconds( v, def, ms )
Converts given variable from string time to number of minutes.
function ng_parseMinutes( v, def )
Converts given variable from number of minutes to string time.
function ng_formatMinutes( v, def, ms )
Converts given variable to web address.
function ng_formatWWW( s, def )
Converts given variable to ASCII string.
function ng_toASCII( s, def )
Converts given variable to non-unicode string.
function ng_toNonUnicode( s, def )
Converts given variable to hexadecimal.
function ng_toHex( v, p, def )
Decodes hexadecimal encoded string.
function ng_Hex2Str( v, p, def )
Finds given value in indexed array.
function ng_idxInArray( value, arr, fromidx, toidx, cmpfnc, userdata )
Tests if given value is in indexed array.
function ng_inArray( value, arr, fromidx, toidx, cmpfnc, userdata )
Gets default date format according to selected language.
function ng_DefaultDateFormat( parse, shortfmt )
Gets default time format according to selected language.
function ng_DefaultTimeFormat( parse, shortfmt )
Gets default date and time format according to selected language.
function ng_DefaultDateTimeFormat( parse, shortfmt )
Gets default date format function.
var ng_DateFormat
Gets default time format function.
var ng_TimeFormat
Gets default date and time format function.
var ng_DateTimeFormat
Extracts date part from datetime variable.
function ng_ExtractDate( dt )
Detects if year is a leap year.
function ng_LeapYear( y )
Determines number of days in month.
function ng_DaysInMonth( m, y )
Formats time to string.
function ng_FormatTime( date, format, def )
Formats date to string.
function ng_FormatDate( date, format, def )
Formats date and time to string.
function ng_FormatDateTime( date, format, def )
Parses time from string.
function ng_ParseTime( date, format, def )
Parses date from string.
function ng_ParseDate( date, format, def )
Parses date and time from string.
function ng_ParseDateTime( val, format, def )
Parses date string formated by JSON encoder.
function ng_ParseJSONDateTime( val, def )
Tries to figure out the date format from given text date.
function ng_GetDateFormat( val, preferEuro )
Trims leading and trailing spaces.
function ng_Trim( s )
Trims leading spaces.
function ng_LTrim( s )
Trims trailing spaces.
function ng_RTrim( s )
Strips given prefix from a string.
function ng_StripPrefix( v, pref, caseinsensitive )
Strips given suffix from a string.
function ng_StripSuffix( v, suff, caseinsensitive )
Adds given prefix to a string (if not already present).
function ng_AddPrefix( v, pref, caseinsensitive )
Adds given suffix to a string (if not already present).
function ng_AddSuffix( v, suff, caseinsensitive )
Adds slash ‘/’ to end of a string (if not already present).
function ng_AddSlash( v )
Strips slash ‘/’ from end of a string.
function ng_StripSlash( v )
Adds backslash ‘\’ to end of a string (if not already present).
function ng_AddBackslash( v )
Strips backslash ‘\’ from end of a string.
function ng_StripBackslash( v )
Strips quotes from quoted string.
function ng_StripQuotes( v, q )
Adds quotes to string.
function ng_QuoteStr( v, q )
Removes thousands separator from string.
function ng_Unformat3Num( v, sep )
Adds thousands separator to string.
function ng_Format3Num( v, sep, rsep )