JQuery 3.3.1, Bootstrap 4.2.1, and the use of the Bootstrap Datepicker
We’re trying to get satisfy some “Content Security Policy” requirements. One of which is to remove the java in the code, and call it from a known js file somewhere. That said I need to place the stuff in a js file which DOES work, but we have to place some java for EACH datepicker, or datetimepicker that exists in the site (which is scalable) so these form elements need to be added from time to time, and as it stands now we’ll need to add to the JS file also.
I’m an absolute tool when it comes to js just FYI.
To the question;
Is there a way to code the JAVA below so it can handle ALL datepickers once? In the past we would write the form element and the js together, so the id's could be created on the fly. With a js file, it complicates things.
$('#datepicker').datepicker({
format: 'yyyy/mm/dd',
calendarWeeks: true,
weekStart: 1,
todayHighlight: true
});