This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [getDigitAt method for numbers that will return either the digit at a specified position or the section of the number between two positions] | |
* @param {[number]} position1 [either the position to search for or the starting position of the slice] | |
* @param {[number]} position2 [*optional*, if supplied, this creates a slice and acts as the end position] | |
* @return {[number]} [either the digit at the specified position or the slice between the specified positions] | |
*/ | |
Number.prototype.getDigitAt = function (position1, position2) { | |
//convert the number to a string to allow array-like access | |
var num = this.valueOf().toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [checkForDuplicateObjects recursively checks an array of objects for duplicate values using angular.equals() to deeply compare objects.] | |
* @param {[array]} _array [the array of objects to be checked] | |
* @return {[boolean]} true or falsey [the function will return true if duplicates are found] | |
*/ | |
function checkForDuplicateObjects(_array) { | |
if (_array.length > 1) { | |
var first = _array[0]; | |
for (var i = 1; i < _array.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Event.getDateRange = function (start, end, cb){ | |
var params = { | |
q: { | |
filters: [ | |
{ | |
name: 'occurrences', | |
op: 'any', | |
val: { | |
'name': 'date', | |
'op': 'gte', |
NewerOlder