Recently, we were working with Google Charts at which we were presenting data from a timeline with some processing. Our JavaScript code was formatted as follows to create Date objects:
1
2
$value = "2020-03-19 23:45:00";
vardateStrFormat = newDate($value);
The above code worked fine on Firefox and Chrome but it failed on Safari with the error: a.getTime is not a function. (In 'a.getTime()', 'a.getTime' is undefined) After some investigation we found that Safari does not support a Date() constructor that contains time as well so we had to change the code to the following block:
The following code will get the query parameters of a URL and assign them to an object called QueryMap. // This function is anonymous, is executed immediately and the return value is assigned to QueryMap. var QueryMap = function () { var query_map = {}; //The search property sets or…
Create an html block in your form and add the following code: gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) { if ( formId == 10 && (fieldId == 30 || fieldId == 32) ) { var ranges = [ { start: new Date('10/01/2021'), end: new Date('10/11/2021') } ];…
Recently, we needed to perform an infinite scroll on a website so that it would load all of its resources (both text and images). As the website was too long and it would take hours to manually scroll little by little, we used the Firefox console and JavaScript to perform…