Software: Apache. PHP/5.5.15 uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 SYSTEM Safe-mode: OFF (not secure) E:\nuevo\htdocs\calendario trimestral\flatpickr-events-calendar\dist\ drwxrwxrwx |
Viewing file: script.js (9.99 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | // generate events var eventDates = {} let day1 = '2023-09-11'; eventDates[day1] = [ 'Dia Nacional de la Biodiversidad', ] let day2 = '2023-09-16'; eventDates[day2] = [ 'Día Internacional de la Preservación de la Capa de Ozono', ] let day3 = '2023-09-24'; eventDates[day3] = [ 'Día Marítimo Mundial', ] let day4 = '2023-10-01'; eventDates[day4] = [ 'Día del Mar y la Riqueza Pesquera', ] let day5 = '2023-10-02'; eventDates[day5] = [ 'Día mundial del hábitat', ] let day6 = '2023-10-03'; eventDates[day6] = [ 'Día Internacional del Agua', ] let day7 = '2023-10-04'; eventDates[day7] = [ 'Día Nacional de los Animales', 'Día Nacional de las Aves' ] let day8 = '2023-10-12'; eventDates[day8] = [ 'Día Mundial del Árbol', ] let day9 = '2023-10-13'; eventDates[day9] = [ 'Día Internacional para la Reducción de los Desastres Naturales', ] let day10 = '2023-10-19'; eventDates[day10] = [ 'Día Nacional de la Guadua', ] let day11 = '2023-10-21'; eventDates[day11] = [ 'Día Mundial del Ahorro de Energía', ] let day12 = '2023-11-01'; eventDates[day12] = [ 'Día Mundial de la Ecología', ] let day13 = '2023-11-06'; eventDates[day13] = [ 'Día Internacional para la Prevención de la Explotación del medio ambiente en la guerra y en los conflictos armados', ] let day14 = '2023-11-09'; eventDates[day14] = [ 'Día de los Parques Nacionales Naturales', ] let day15 = '2023-11-17'; eventDates[day15] = [ 'Día del Ambientalista Latinoamericano', ] let day16 = '2023-11-19'; eventDates[day16] = [ 'Día Internacional del Aire Puro', ] let day17 = '2023-11-22'; eventDates[day17] = [ 'Día Nacional de la Orquídea', ] let day18 = '2023-11-26'; eventDates[day18] = [ 'Día Mundial contra el uso indiscriminado de Agroquímicos', ] let day19 = '2023-12-05'; eventDates[day19] = [ 'Día Mundial del Suelo', 'Día Mundial del Voluntario y Ciudadano Ambiental', 'Día Mundial de los Arrecifes de Coral' ] let day20 = '2023-12-10'; eventDates[day20] = [ 'Día Mundial de los Derechos Humanos', ] let day21 = '2023-12-11'; eventDates[day21] = [ 'Día Internacional de las Montañas', ] let day22 = '2023-12-15'; eventDates[day22] = [ 'Creación del Programa de las Naciones Unidas para el Medio Ambiente', ] let day23 = '2023-12-22'; eventDates[day23] = [ 'Aniversario de la Ley 99 Sistema Nacional Ambiental SINA', ] let day24 = '2024-01-26'; eventDates[day24] = [ 'Día Nacional de la Educación Ambiental', ] let day25 = '2024-01-28'; eventDates[day25] = [ 'Día Mundial de la Acción frente al calentamiento global', ] let day26 = '2024-02-02'; eventDates[day26] = [ 'Día Internacional de los humedales', ] let day27 = '2024-02-03'; eventDates[day27] = [ 'Día Internacional sin pitillo', ] let day28 = '2024-02-07'; eventDates[day28] = [ 'Día sin carro en Bogotá', ] let day29 = '2024-02-18'; eventDates[day29] = [ 'Día internacional del control biológico', ] let day30 = '2024-02-21'; eventDates[day30] = [ 'Día Internacional para la protección de los osos', ] let day31 = '2024-03-01'; eventDates[day31] = [ 'Día Nacional del reciclador', ] let day32 = '2024-03-03'; eventDates[day32] = [ 'Día Mundial de la vida silvestre', ] let day33 = '2024-03-05'; eventDates[day33] = [ 'Día de la eficiencia energética', ] let day34 = '2024-03-14'; eventDates[day34] = [ 'Día Internacional de la Acción por los Ríos', ] let day35 = '2024-03-21'; eventDates[day35] = [ 'Día Mundial Forestal', 'Día internacional de los bosques' ] let day36 = '2024-03-22'; eventDates[day36] = [ 'Día Mundial del Agua', ] let day37 = '2024-03-23'; eventDates[day37] = [ 'Día Metereológico Mundial', ] let day38 = '2024-03-26'; eventDates[day38] = [ 'Día Mundial del Clima', ] let day39 = '2024-03-28'; eventDates[day39] = [ 'La Hora del Planeta', ] let day40 = '2024-04-09'; eventDates[day40] = [ 'Día del Saneamiento Ambiental', ] let day41 = '2024-04-22'; eventDates[day41] = [ 'Día Internacional de la Tierra', ] let day42 = '2024-04-27'; eventDates[day42] = [ 'Día Internacional de la Concienciación sobre el Ruido', ] let day43 = '2024-04-29'; eventDates[day43] = [ 'Día Nacional del Árbol', ] let day44 = '2024-05-04'; eventDates[day44] = [ 'Día Internacional del Combatiente de incendios forestales', ] let day45 = '2024-05-09'; eventDates[day45] = [ 'Día Internacional de las Aves', ] let day46 = '2024-05-12'; eventDates[day46] = [ 'Día del Río Bogotá', ] let day47 = '2024-05-16'; eventDates[day47] = [ 'Día Mundial de la Migración de peces', ] let day48 = '2024-05-17'; eventDates[day48] = [ 'Día Internacional del Reciclaje', ] let day49 = '2024-05-20'; eventDates[day49] = [ 'Día Mundial de las Abejas', ] let day50 = '2024-05-21'; eventDates[day50] = [ 'Día del Sol', ] let day51 = '2024-05-22'; eventDates[day51] = [ 'Día Internacional de la Biodiversidad', ] let day52 = '2024-05-23'; eventDates[day52] = [ 'Día Mundial de las Tortugas', ] let day53 = '2024-06-03'; eventDates[day53] = [ 'Día Mundial del ambiente', 'Día Mundial de la Bicicleta' ] let day54 = '2024-06-05'; eventDates[day54] = [ 'Día Mundial del Medio Ambiente', ] let day55 = '2024-06-08'; eventDates[day55] = [ 'Día Mundial de los Océanos', ] let day56 = '2024-06-16'; eventDates[day56] = [ 'Día Mundial de las Tortugas Marinas', ] let day57 = '2024-06-17'; eventDates[day57] = [ 'Día Mundial contra la Desertificación y la Sequía', ] /* let day58 = '2024-06-22'; eventDates[day58] = [ 'Día Mundial del Suelo y de la Tierra Fértil', ] */ let day58 = '2024-06-22'; eventDates[day58] = [ 'Día Internacional de los Bosques Tropicales', ] let day59 = '2024-06-26'; eventDates[day59] = [ 'Día Internacional de los Bosques Tropicales', ] let day60 = '2024-07-03'; eventDates[day60] = [ 'Día sin bolsas plásticas', ] let day61 = '2024-07-04'; eventDates[day61] = [ 'Día Internacional de la Vida Silvestre', 'Día de la Constitución Ambiental' ] let day62 = '2024-07-07'; eventDates[day62] = [ 'Día de la Conservación del Suelo', ] let day63 = '2024-07-11'; eventDates[day63] = [ 'Día Mundial de la Población', ] let day64 = '2024-07-15'; eventDates[day64] = [ 'Día internacional de las tecnologías apropiadas', ] let day65 = '2024-07-15'; eventDates[day65] = [ 'Día Internacional de la Defensa del Manglar', ] let day66 = '2024-07-30'; eventDates[day66] = [ 'Día Nacional de la Vida Silvestre', ] let day67 = '2024-08-09'; eventDates[day67] = [ 'Día del Cóndor', 'Día Internacional de las Poblaciones Indígenas' ] let day68 = '2024-08-13'; eventDates[day68] = [ 'Día Nacional de las Organizaciones Ecologistas y Ambientales', ] let day69 = '2024-08-14'; eventDates[day69] = [ 'Día Interamericano de la Calidad del Aire', ] let day70 = '2024-08-14'; eventDates[day70] = [ 'Día Mundial del No Ruido', ] /* let day2 = formatDate(new Date(new Date().setDate(new Date().getDate() + 8))) eventDates[day2] = [ 'Evento 1, Dia de la tierra', ] let day3 = '2023-08-28'; eventDates[day3] = [ 'Día de reunión con diana', ] let day4 = '2023-04-29'; eventDates[day4] = [ 'Día de reunión jefe', 'Día de juan' ] */ // set maxDates var maxDate = { 1: new Date(new Date().setMonth(new Date().getMonth() + 11)), 2: new Date(new Date().setMonth(new Date().getMonth() + 10)), 3: new Date(new Date().setMonth(new Date().getMonth() + 9)) } var flatpickr = $('#calendar .placeholder').flatpickr({ inline: true, minDate: 'today', maxDate: maxDate[3] , showMonths: 1, enable: Object.keys(eventDates), disableMobile: "true", onChange: function(date, str, inst) { var contents = ''; if(date.length) { for(i=0; i < eventDates[str].length; i++) { contents += '<div class="event"><div class="date">' + flatpickr.formatDate(date[0], 'l J F') + '</div><div class="location">' + eventDates[str][i] + '</div></div>'; } } $('#calendar .calendar-events').html(contents) }, locale: { weekdays: { shorthand: ["D", "L", "M", "M", "J", "V", "S"], longhand: [ "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado", ] } ,months: { shorthand: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], longhand: [ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre", ] } ,days: { shorthand: ["uno", "dos", "tres", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], longhand: [ "1", "2", "3", "4", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre", ] } } }) eventCaledarResize($(window)); $(window).on('resize', function() { eventCaledarResize($(this)) }) function eventCaledarResize($el) { var width = $el.width() if(flatpickr.selectedDates.length) { flatpickr.clear() } if(width >= 992 && flatpickr.config.showMonths !== 3) { flatpickr.set('showMonths', 3) flatpickr.set('maxDate', maxDate[3]) } if(width < 992 && width >= 768 && flatpickr.config.showMonths !== 2) { flatpickr.set('showMonths', 2) flatpickr.set('maxDate', maxDate[2]) } if(width < 768 && flatpickr.config.showMonths !== 1) { flatpickr.set('showMonths', 1) flatpickr.set('maxDate', maxDate[1]) $('.flatpickr-calendar').css('width', '') } } function formatDate(date) { let d = date.getDate(); let m = date.getMonth() + 1; //Month from 0 to 11 let y = date.getFullYear(); return '' + y + '-' + (m<=9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d); } |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]-- |