/**
 * This file is to add the color and more information in post page.
 * Uses jQuery-ui.js
 */
(function ($) {
    "user strict";

    $(document).ready(function ($) {

        // Date Picker (it is in Metabox)
        $("#event_start").datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            onClose: function (selectedDate) {
                $("#event_start").datepicker("option", "minDate", selectedDate);
            }
        });

        $("#event_finish").datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            onClose: function (selectedDate) {
                $("#event_finish").datepicker("option", "maxDate", selectedDate);
            }
        });

        $("#format_options").change(function () {
            $("#event_start").datepicker("option", "dateFormat", $(this).val());
            $("#event_finish").datepicker("option", "dateFormat", $(this).val());
        });

    });

})( jQuery );