PageSourceSearch

https://kayaskinconsult.ai/static/js/rescalendar.js

js kayaskinconsult.ai collected 2026-10-05 12:08:26 UTC 4,257 bytes, 94 lines download raw bytes

1(function($) {
2    var date = $("#lastVisited").val();
3    var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
4    jsDate = new Date(date);
5    days = days[jsDate.getDay()]
6    console.log(days);
7    $.fn.rescalendar = function( options ) {
8        function set_template( targetObj, settings ){
9            template = settings.template_html( targetObj, settings );
10            targetObj.html( template );
11            return true;
12        };      
13        function setDayCells( targetObj, refDate ){
14            var format   = settings.format,
15                f_inicio = moment( refDate, format ).subtract(settings.jumpSize, 'days'),           
16                today    = moment( ).startOf('day'),
17                html            = '<td class="firstColumn"></td>',
18                f_aux           = '',
19                f_aux_format    = '',
20                day             = '',
21                weekdays        = '',               
22                clase_middleDay = '',
23                clase_disabled  = '',
24                middleDay       = targetObj.find('input.refDate').val();
25                for( var i = 0; i< (settings.calSize + 1) ; i++){
26                f_aux        = moment( f_inicio ).add(i, 'days');
27                f_aux_format = f_aux.format( format );
28                day        = f_aux.format('DD');
29                mes        = f_aux.locale( settings.locale ).format('MMM').replace('.','');
30                weekdays = f_aux.locale( settings.locale ).format('dd');
31             
32                f_aux_format == today.format( format ) ? clase_today     = 'today'         : clase_today = '';
33                html += [
34                    '<td class="day_cell ' + clase_today + ' ' + clase_middleDay + ' ' + clase_disabled + '" data-cellDate="' + f_aux_format + '">',
35                        '<span class="weekdays">' + weekdays + '</span>',
36                        '<span class="day">' + day + '</span>',                      
37                    '</td>'
38                ].join('');
39            }
40            targetObj.find('.rescalendar_day_cells').html( html );
41            addTdClickEvent( targetObj );
42            setData( targetObj )      
43        }
44        function addTdClickEvent(targetObj){
45            var day_cell = targetObj.find('td.day_cell');
46            day_cell.on('click', function(e){           
47                var cellDate = e.currentTarget.attributes['data-cellDate'].value;
48                targetObj.find('input.refDate').val( cellDate );
49                setDayCells( targetObj, moment(cellDate, settings.format) );
50            });
51        }
52        // INITIALIZATION
53        var settings = $.extend({
54            id           : 'rescalendar',
55            format       : 'DD-MM-YYYY',
56            refDate      : moment().format( 'DD-MM-YYYY' ),
57            jumpSize     : 15,
58            calSize      : 30,
59            locale       : 'en',
60            disabledDays : [],
61            disabledWeekDays: [],
62            dataKeyField: 'name',
63            dataKeyValues: [],
64            data: {},
65            template_html: function( targetObj, settings ){              
66                var id      = targetObj.attr('id'),
67                    refDate = settings.refDate ;
68                return [
69                    `<div class="rescalendar"  id="_wrapper">
70                        <div class="rescalendar_controls">
71                            <span class="refDate mb-4 pl-3 text-left border-0"> ${date} </span>
72                        </div>
73                        <table class="rescalendar_table">
74                            <thead>
75                                <tr class="rescalendar_day_cells"></tr>
76                            </thead>
77                            <tbody class="rescalendar_data_rows">                             
78                            </tbody>
79                        </table>                 
80                    </div>`,
81             ].join('');
82            }
83        }, options);
84        return this.each( function() {          
85            var targetObj = $(this);
86            set_template( targetObj, settings);
87            setDayCells( targetObj, settings.refDate );
88            return this;
89        });
90
91    } // end rescalendar plugin
92
93
94}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.