|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
-
- 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 '';
- }
- }
-
- function log(msg) {
- try {
- console.log(msg);
- } catch (e) {
-
- }
- }
-
- 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;
- }
|