Members
(static) alphaToPhoneNumeric
Takes a string input and converts A-Z to their respective phone number character
1800CALLME
-> 1800225563
- Source:
(static) bytesText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in file size formatter |
- Source:
(static) canvasDraw
Takes a 2D array of [[x,y],[x,y]]
number coordinates and draws them onto the provided canvas
The first point marks where the "pen" starts, each sequential point is then "drawn to" as if holding a
pen on paper and moving the pen to the new point.
- Source:
(static) decode
Takes a String and decodes &
, <
, >
, "
from HTML entities back to the character
- Source:
(static) encode
Takes a String and encodes &
, <
, >
, "
, '
, and /
to HTML entities
- Source:
(static) falseText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in bool formatter for false values |
- Source:
(static) fixed
Takes a number and decimal place and floors the number to that place:
fixed(5.555, 0)
=> 5
fixed(5.555, 2)
=> 5.55
fixed(5.555, 5)
=> 5.555
- Source:
(static) hoursText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in timespan formatter for more than one hour |
- Source:
(static) hourText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in timespan formatter for exactly one hour |
- Source:
(static) imageFromVector
Returns the image data (or img element) for a series of vectors
- Source:
(static) isEmpty
Determines if the given item is an empty string or empty arry
- Source:
(static) mail
Takes an email string and wraps it with an <a>
element with href="mailto:"
pointing to the email.
- Source:
(static) minutesText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in timespan formatter for more than one minute |
- Source:
(static) minuteText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in timespan formatter for exactly one minute |
- Source:
(static) nl2br
Takes a string and converts all new lines \n
to HTML <br>
elements.
- Source:
(static) noText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in yesNo formatter for false values |
- Source:
(static) percentFormatText
Properties:
Name | Type | Description |
---|---|---|
format |
String | string for percent
|
- Source:
(static) phone
Takes a string phone input and attempts to match it against the predefined phone formats - if a match is found it is returned formatted if not it is returned as is.
- Source:
(static) phoneFormat
Properties:
Name | Type | Description |
---|---|---|
Array |
Array.<Object> | of objects that have the keys The RegExp may have capture groups but when you are defining the format strings use:
The The three default formatters are:
If you plan to override this value make sure you include the default ones provided. |
- Source:
(static) trim
Removes whitespace from from and end of string
- Source:
(static) trueText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in bool formatter for true values |
- Source:
(static) yesText
Properties:
Name | Type | Description |
---|---|---|
Text |
String | used in yesNo formatter for true values |
- Source:
Methods
(static) bool(val) → {String}
Takes a boolean value and returns the string T or F for true or false
Parameters:
Name | Type | Description |
---|---|---|
val |
Boolean/String | If string it tests if the string is |
- Source:
Returns:
T for true, F for false.
- Type
- String
(static) date(val, fmt, utc) → {String}
Takes a date and format string and returns the formatted date as a string.
Parameters:
Name | Type | Description |
---|---|---|
val |
Date/String | Date to be converted. If string is passed it is converted to a date using Converts toDateFromString. |
fmt |
String | Format string following datejs formatting. |
utc |
Boolean | If a date should be in UTC time set this flag to true to counter-act javascripts built-in timezone applier. |
- Source:
Returns:
Date formatted as a string.
- Type
- String
(static) link(val) → {String}
Takes a url string and wraps it with an <a>
element with href=
pointing to the url.
Parameters:
Name | Type | Description |
---|---|---|
val |
String | Url string to be wrapped |
- Source:
Returns:
An <a>
element as a string.
- Type
- String
(static) percent(val, places) → {String}
Takes a decimal number, multiplies by 100 and adds the % sign with the number of palces to the right.
perecent(0.35)
=> '35.00%'
perecent(0.35, 0)
=> '35%'
percent(2.9950)
=> '299.50%'
percent(2.9950,0)
=> '300%'
Parameters:
Name | Type | Description |
---|---|---|
val |
Number/String | The value will be |
places |
Number/String | If no value is given the default value will be set to 2. |
- Source:
Returns:
Number as a percentage with % sign.
- Type
- String
(static) timespan(val) → {String}
Takes a number of minutes and turns it into the string: 'n hours m minutes'
Parameters:
Name | Type | Description |
---|---|---|
val |
Number/String | Number of minutes, will be |
- Source:
Returns:
A string representation of the minutes as 'n hours m minutes'
- Type
- String
(static) yesNo(val) → {String}
Takes a boolean value and returns the string Yes or No for true or false
Parameters:
Name | Type | Description |
---|---|---|
val |
Boolean/String | If string it tests if the string is |
- Source:
Returns:
Yes for true, No for false.
- Type
- String