maps.nyc.gov

Namespace: util

nyc.util

Source:

Methods

(static) formatDateHtml(options) → {JQuery}

Format HTML content to locale specific date format
Parameters:
Name Type Description
options nyc.util.FormatDateHtmlOptions The options for formatting dates
Source:
Returns:
The elements that have been formatted
Type
JQuery

(static) formatNumberHtml(options) → {JQuery}

Format numeric HTML content to locale specific number format
Parameters:
Name Type Description
options nyc.util.FormatNumberHtmlOptions The options for formatting numbers
Source:
Returns:
The elements that have been formatted
Type
JQuery

(static) formatPhone(phone) → {string}

A function format phone numbers
Parameters:
Name Type Description
phone string The phone number
Source:
Returns:
Type
string

(static) isAndroid() → {boolean}

Check if OS is Android
Source:
Returns:
Type
boolean

(static) isIe() → {boolean}

Check if browser is IE
Source:
Returns:
Type
boolean

(static) isIos() → {boolean}

Check if OS is iOS
Source:
Returns:
Type
boolean

(static) isMobile() → {boolean}

Check if user agent is mobile
Source:
Returns:
Type
boolean

(static) isSafari() → {boolean}

Check if browser is Safari
Source:
Returns:
Type
boolean

(static) pad(val, len, chropt) → {string}

A function to pad values
Parameters:
Name Type Attributes Default Description
val string | number The value to pad
len number The length of the padded result
chr string <optional>
0 The padding character
Source:
Returns:
Type
string

(static) preventDblEventHandler(event, handler, scopeopt)

A click event handler for HTML elements that will not fire twice on certain mobile devices
Parameters:
Name Type Attributes Description
event JQuery.Event The event object
handler function The event handler function
scope Object <optional>
The scope in which to invoke the event handler
Source:

Type Definitions

FormatDateHtmlOptions

Object type to hold arguments for nyc.util.formatDateHtml
Type:
  • Object
Properties:
Name Type Attributes Description
elements JQuery | string The HTML elements to format
lang string <optional>
The language code for formatting
options Object <optional>
The options for Date#toLocaleString {@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString}
Source:

FormatNumberHtmlOptions

Object type to hold arguments for nyc.util.formatNumberHtml
Type:
  • Object
Properties:
Name Type Attributes Description
elements JQuery | string The HTML elements to format
lang string <optional>
The language code for formatting
options Object <optional>
The options for Number#toLocaleString {@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString}
Source:

nyc-lib: Namespace: util

maps.nyc.gov

Namespace: util

nyc.util

Source:

Methods

(static) formatDateHtml(options) → {JQuery}

Format HTML content to locale specific date format
Parameters:
Name Type Description
options nyc.util.FormatDateHtmlOptions The options for formatting dates
Source:
Returns:
The elements that have been formatted
Type
JQuery

(static) formatNumberHtml(options) → {JQuery}

Format numeric HTML content to locale specific number format
Parameters:
Name Type Description
options nyc.util.FormatNumberHtmlOptions The options for formatting numbers
Source:
Returns:
The elements that have been formatted
Type
JQuery

(static) formatPhone(phone) → {string}

A function format phone numbers
Parameters:
Name Type Description
phone string The phone number
Source:
Returns:
Type
string

(static) isAndroid() → {boolean}

Check if OS is Android
Source:
Returns:
Type
boolean

(static) isIe() → {boolean}

Check if browser is IE
Source:
Returns:
Type
boolean

(static) isIos() → {boolean}

Check if OS is iOS
Source:
Returns:
Type
boolean

(static) isMobile() → {boolean}

Check if user agent is mobile
Source:
Returns:
Type
boolean

(static) isSafari() → {boolean}

Check if browser is Safari
Source:
Returns:
Type
boolean

(static) pad(val, len, chropt) → {string}

A function to pad values
Parameters:
Name Type Attributes Default Description
val string | number The value to pad
len number The length of the padded result
chr string <optional>
0 The padding character
Source:
Returns:
Type
string

(static) preventDblEventHandler(event, handler, scopeopt)

A click event handler for HTML elements that will not fire twice on certain mobile devices
Parameters:
Name Type Attributes Description
event JQuery.Event The event object
handler function The event handler function
scope Object <optional>
The scope in which to invoke the event handler
Source:

Type Definitions

FormatDateHtmlOptions

Object type to hold arguments for nyc.util.formatDateHtml
Type:
  • Object
Properties:
Name Type Attributes Description
elements JQuery | string The HTML elements to format
lang string <optional>
The language code for formatting
options Object <optional>
The options for Date#toLocaleString {@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString}
Source:

FormatNumberHtmlOptions

Object type to hold arguments for nyc.util.formatNumberHtml
Type:
  • Object
Properties:
Name Type Attributes Description
elements JQuery | string The HTML elements to format
lang string <optional>
The language code for formatting
options Object <optional>
The options for Number#toLocaleString {@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString}
Source: