awa.func Class
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/func.js:11
Item Index
Methods
colorIsDark
-
color
Parameters:
-
colorStringAn rgb string in #000000 format
Returns:
Whether or not the color is a dark color
get_gender_icon
-
gender -
classes
Returns gender icon based on first character of string provided
Parameters:
-
genderStringMALE, FEMALE
-
classesStringAdditional CSS classes to apply to icon element
Returns:
Gender icon as html string
get_icon
-
name -
size -
title -
classes
Returns icon to display as html
Parameters:
-
nameStringIcon name
-
sizeStringIcon size, defaults to 16
-
titleStringTitle attribute
-
classesStringAdditional CSS classes to apply to icon element
Returns:
Icon as html string
invertColor
-
color
Parameters:
-
colorStringAn rgb string in #000000 format
Returns:
The inverted color or ''
mysql_datetime_format_short
-
dt
Returns a formatted, client-localised date from a given mysql timestamp. all mysql timestamps are based on EST and must be localised Formats based on date: (today): outputs time, period, and timezone, (current year): outputs abbreviated month and numeric day (default): MM/dd/yyyy
Parameters:
-
dtString | Datestring representing a date, or the date
Returns:
date in MM/dd/yy
number_format
-
number -
decimals -
dec_point -
thousands_sep
Parameters:
-
numberNumber | Stringa number to format
-
decimalsNumber | Stringnumber of decimals to be shown
-
dec_pointNumber | Stringdecimal marker
-
thousands_sepNumber | Stringthouusands marker
Returns:
formatted number string
number_to_sequence
-
val
Changes a number to it's readable sequence equivalent. i.e. 1 => primary or 3 => tertiary NOTE: supports only up to 3 because I'm lazy
Parameters:
-
valNumber | Stringa number
Returns:
a string for the sequence
ordinal_format
-
val
Converts the provided number value to its ordinal format. (i.e. 1 => 1st, 2 => 2nd)
Parameters:
-
valNumber | Stringa number
Returns:
number in ordinal format
phone_format
-
num
Parameters:
-
numStringPhone #
Returns:
Formatted phone number. do not use for processing/logic
validateEmail
-
email
Parameters:
-
emailStringEmail address to validate
Returns:
return true if valid email