resources/js/vendors/bootstrap-datepicker.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 42
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 27
c 0
b 0
f 0
dl 0
loc 42
rs 10
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0
1
$(document).ready(function() {
2
3
    var today = new Date();
4
5
    // Single selection - Past and future allowed
6
    $('.datepicker.all input').datepicker({
7
        format: 'dd/mm/yyyy',
8
        daysOfWeekHighlighted: "6,0",
9
        weekStart: 1,
10
        todayHighlight: true,
11
    });
12
13
    // Single selection - Just for past dates
14
    $('.datepicker.past input').datepicker({
15
        format: 'dd/mm/yyyy',
16
        daysOfWeekHighlighted: "6,0",
17
        weekStart: 1,
18
        endDate : today,
19
        todayHighlight: true,
20
    });
21
22
    // Single selection -  Just for future dates
23
    $('.datepicker.future input').datepicker({
24
        format: 'dd/mm/yyyy',
25
        daysOfWeekHighlighted: "6,0",
26
        weekStart: 1,
27
        startDate: today,
28
        todayHighlight: true,
29
    });
30
31
    // Multiple date selection
32
    $('.datepickerMultiple input').datepicker({
33
        format: 'dd/mm/yyyy',
34
        daysOfWeekHighlighted: "6,0",
35
        weekStart: 1,
36
        todayHighlight: true,
37
        startDate: today,
38
        multidate: true,
39
        multidateSeparator: ","
40
    });
41
42
});