/home/mip/mip/app/Modules/Client/Views/job-opening/includes/js.blade.php
<script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js')}}"></script>
{!! JsValidator::formRequest('QxCMS\Modules\Client\Requests\JobOpening\JobOpeningRequest', 'form#job-form'); !!}
<script>
$(function(){
    var body = $('body');
    $("#opening_date, #closing_date").inputmask(body.data('datepicker-mask'), {"placeholder": body.data('datepicker-mask')});
    $("#opening_date, #closing_date").datepicker({ 
        yearRange: "1970:+0",
        changeMonth: true,
        changeYear: true,
        minDate: 0,
        dateFormat: body.data('datepicker-format'),
        onSelect: function(datetext){
            $(this).valid();
        }
    });

    var date = new Date();
    date.setMonth(date.getMonth() + 1);
    $(".closing_date").datepicker('setDate', date);
    $('.opening_date').datepicker("setDate", "0");

    $.validator.setDefaults({ ignore: '' });
    $(function(){
        $('textarea[name="job_details"]').wysihtml5({
            toolbar: {
                "font-styles": true, // Font styling, e.g. h1, h2, etc.
                "emphasis": true, // Italics, bold, etc.
                "lists": true, // (Un)ordered lists, e.g. Bullets, Numbers.
                "html": false, // Button which allows you to edit the generated HTML.
                "link": false, // Button to insert a link.
                "image": false, // Button to insert an image.
                "color": false, // Button to change color of font
                "blockquote": false, // Blockquote
            }
        });
    });
    $('input').iCheck({
        checkboxClass: 'icheckbox_square-blue',
        radioClass: 'iradio_square-blue',
        decreaseArea: '20%',
    })

    var min_age = $('.min_age').val();
    var max_age = $('.max_age').val();
    if(min_age == 0){
        $('.min_age').val('');
    }
    if(max_age == 0){
        $('.max_age').val('');
    }

    $('#job-details-modal').on('show.bs.modal', function (event) {
        var modal = $(this);
        var href = $(event.relatedTarget);
        var details_url = href.data('details_url');

        $.ajax({
            url: details_url,
            type: 'GET',
        }).done(function(response){
            modal.find('.position_title').html(response.position);
            modal.find('.applicants_needed').html(response.no_position);
            modal.find('.proposed_salary').html(response.proposed_salary);
            modal.find('.location').html(response.location);
            modal.find('.country').html(response.country.name);
            modal.find('.gender').html(response.gender);
            modal.find('.min_age').html(response.max_age != 0 ? response.max_age : 'N/A');
            modal.find('.max_age').html(response.min_age != 0 ? response.min_age : 'N/A');
            modal.find('.status').html(response.status);
            modal.find('.opening_date').html(moment(response.opening_date).format('MMMM DD, YYYY'));
            modal.find('.closing_date').html(moment(response.closing_date).format('MMMM DD, YYYY'));
            modal.find('.job_details').html(response.job_details != '' ? response.job_details : 'N/A');
        })
    });

    $('#job-details-modal').on('hidden.bs.modal', function (event) {
        var modal = $(this);

        modal.find('.position_title').html('');
        modal.find('.applicants_needed').html('');
        modal.find('.proposed_salary').html('');
        modal.find('.location').html('');
        modal.find('.country').html('');
        modal.find('.gender').html('');
        modal.find('.min_age').html('');
        modal.find('.max_age').html('');
        modal.find('.status').html('');
        modal.find('.opening_date').html('');
        modal.find('.closing_date').html('');
        modal.find('.job_details').html('');
    });
});
</script>