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
// Returns the index of the first character contained in searchChars | |
// From Apache Commons Lang, http://commons.apache.org/lang/ | |
public static int indexOfAny(String str, char[] searchChars) { | |
if (isEmpty(str) || ArrayUtils.isEmpty(searchChars)) { | |
return -1; | |
} | |
for (int i = 0; i < str.length(); i++) { | |
char ch = str.charAt(i); | |
for (int j = 0; j < searchChars.length; j++) { | |
if (searchChars[j] == ch) { |
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
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
NewerOlder