$(document).ready(function() {
    var v_hoy = new Date();
    $("#txt_fecha").datetimepicker({
        locale: 'es',
        format: "dd-mm-yyyy",
        autoclose: true,
        todayBtn: true,
        minView: 2,
        pickerPosition: "bottom",
        startDate: v_hoy
    });

    $("#frm_fechaInactiva").validate({
        rules: {
            txt_fecha: {
                required: true
            },
            txt_horaInicio: {
                required: true
            },
            txt_horaFin: {
                required: true
            },
            txt_motivo: {
                required: true
            }
        },
        submitHandler: function(form) {

            guardarFechaInactiva();

        },
        highlight: function(element) {
            $(element).closest('div').addClass('has-error');
        },
        unhighlight: function(element) {
            $(element).closest('div').removeClass('has-error');
        },
        errorElement: 'span',
        errorClass: 'help-block'
    });

});