This file contains a series of functionalities related to sorting objects.
Methods
# static orderByDateTime(arr, keyopt) → {Array.<object>}
Order array of elements by a timestamp attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arr |
Array.<object>
|
Array of objects to sort. |
||
key |
string
|
<optional> |
'eventdate' | Key of the eventdate attribute. |
- Sorted array.
Array.<object>
# static rankingByFloat(arr, key, value, num) → {Array}
Get a ranking given a specfic configuration.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array.<object>
|
Array of objects to rank. |
key |
string
|
The name of the object key to rank. |
value |
string
|
The name of the object key with the value. |
num |
number
|
The number of elements for the ranking. |
- Array of objects with the key and value sorted.
Array