7 examples of 'jquery datepicker disable dates dynamically' in JavaScript

Every line of 'jquery datepicker disable dates dynamically' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
83_getDate(date, minDate = this.state.minDate, maxDate = this.state.maxDate) {
84 // If no date is provided then use current date
85 // Make sure we constrain it to the min and max
86 const current = (date instanceof Date) ? date : new Date();
87
88 if (minDate && current < minDate) {
89 return minDate;
90 }
91
92 if (maxDate && current > maxDate) {
93 return maxDate;
94 }
95
96 return current;
97}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

18function updateDatePicker() {
19
20 var startMonth = new Date();
21
22 $("#dpStart").datepicker("option", "dateFormat", "yy-mm-dd");
23 $("#dpStart").datepicker("setDate", startMonth);
24}
225getDates() {
226
227 // Depending on the show/hide state when called, this.dates may or may not be populated.
228 // Use it if populated (i.e. initial #update before show), not based on #isShowing
229 return (this.dates ? this.dates.array : undefined) || this.parseDateArrayFromInput()
230}
52function initializeDatepicker(div) {
53 return div.datepicker({
54 weekStart: 0,
55 startView: 0,
56 minViewMode: 0,
57 autoclose: false
58 });
59}
60function setDatePicker(){
61 var dates = $( "#f1, #f2" ).datepicker({
62 changeMonth: true,
63 changeYear: true,
64 numberOfMonths: 1,
65 dateFormat: "dd.mm.yy",
66 minDate: "01.01."+times[currentLevel+1][firstBar][1],
67 maxDate: "31.12."+times[currentLevel+1][lastBar][1],
68 //beforeShow: function(input, inst) {
69 // $("#ui-datepicker-div").css("z-index", 100);
70 //},
71 onSelect: function( selectedDate ) {
72 var option = this.id == "f1" ? "minDate" : "maxDate",
73 instance = $( this ).data( "datepicker" ),
74 date = $.datepicker.parseDate(
75 instance.settings.dateFormat ||
76 $.datepicker._defaults.dateFormat,
77 selectedDate, instance.settings );
78 dates.not( this ).datepicker( "option", option, date );
79 }
80 });
81 $('#ui-datepicker-div').hide();
82}
162_cloneDate ( date ) {
163
164 return new Date ( date.getTime () );
165
166}
201private loadjQuery(callback: () => void) {
202 const jQuery = (window as any).jQuery;
203 if (!jQuery) {
204 const link = 'https://code.jquery.com/jquery-3.3.1.min.js';
205
206 let element = document.createElement('script');
207 element.setAttribute('type', 'text/javascript');
208 element.setAttribute('src', link);
209 element.onload = callback;
210 (element as any).onreadystatechange = callback;
211 document.head.appendChild(element);
212 } else {
213 callback();
214 }
215}

Related snippets