$(document).ready(function() {
    $('#income-table').DataTable({
        "lengthChange": false,
        "info": false,
        "pageLength": 20,
        "language": {
            "emptyTable": "ไม่พบข้อมูล",
            "paginate": {
                "first": "หน้าแรก",
                "last": "หน้าสุดท้าย",
                "next": "ถัดไป",
                "previous": "ก่อนหน้า"
            },
            "search": "ค้นหา:",
            "lengthMenu": "จำนวนผู้สอนทั้งหมด _MENU_ คน",
            "info": "ทั้งหมด _TOTAL_ คน",
            "infoEmpty": "ไม่พบผู้สอน",
        }
    });

    $('.selectpicker').selectpicker();

    $('#date').datepicker({
        format: 'mm/yyyy',
        autoclose: true,
        language: 'th',
        orientation: 'bottom',
        endDate: '+0m',
        startView: 'months',
        minViewMode: 'months',
    });

    $('#payDate').datepicker({
        format: 'dd/mm/yyyy',
        autoclose: true,
        language: 'th',
        orientation: 'bottom',
    }).datepicker("setDate", 'now');

    $('#payTime').timepicker({
        showMeridian: false,
        showSeconds: true,
        minuteStep: 1,
        secondStep: 1,
        icons: {
            up: 'fa fa-angle-up',
            down: 'fa fa-angle-down'
        }
    });

    $('#incomeModal').on('hidden.bs.modal', function() {
        $("#incomeFrm").trigger("reset");
        $('.selectpicker').selectpicker('refresh');
    });

});