Created
November 18, 2012 02:35
-
-
Save Serabe/4103051 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Función principal de inicialización del calendario de la home. | |
* Se encarga de inicializar todos los valores. | |
*/ | |
var cargar_semanas = function(id){ | |
// Averiguar anyo y mes actual | |
var date = $('#calendario_agenda').datepicker('getDate'); | |
var year = $('#calendario_agenda .ui-datepicker-year option:selected').val(); | |
var txt_month = $('#calendario_agenda .ui-datepicker-month').text(); | |
var month = -1; | |
// Buscar en el bloque de html con los meses el id al que corresponde | |
$('#calendario_nombre_meses option').each(function(){ | |
if($(this).text() == txt_month){ | |
month = parseInt($(this).val()); | |
} | |
}); | |
// Fragmento que se encarga de sustituir los números de semana por flechas con enlace | |
$(id+' .ui-datepicker-week-col').each(function(){ | |
// Sobreescribir texto antiguo por enlace con flecha y asociar accion onclick | |
$(this).html('<a href="#" class="calendar-week" onclick="calcularYMostrarSemana('+month+', '+year+'); return false;">></a>'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment