function arrayRemove(arr, value) { return arr.filter(function(ele){ return ele != value; });} const scratchDiv = document.createElement('div'); function toPlainText(html) { scratchDiv.innerHTML = html; return scratchDiv.textContent; } function getDateFormatted(date, separator) { if(date) { var date = new Date(date); var _d = date.getDate(), d = _d > 9 ? _d : '0' + _d, _m = date.getMonth() + 1, m = _m > 9 ? _m : '0' + _m, formatted = d + separator + m + separator + date.getFullYear(); return formatted; }else{ return ''; } } var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; function indexOfFirstDigit(input) { let i = 0; for (; input[i] < '0' || input[i] > '9'; i++) ; return i == input.length ? -1 : i; } function indexOfLastDigit(input) { let i = input.length - 1; for (; input[i] < '0' || input[i] > '9'; i--) ; return i == input.length ? -1 : i; }