"use strict";
(function ($) {
    $.field_birthday = function (element, options) {
        var defaults = {
            input_name: ""
        }
        var plugin = this;
        plugin.settings = {}
        var $element = $(element), 
            element = element;    
        
        plugin.init = function () {
            $element.find('.btn-date').on('click', function (e) {
                let input_name = plugin.settings.input_name;
                e.preventDefault();
                $.dateSelect.show({
                    element: `input[name="${input_name}"]`
                });
            });
        }
        plugin.example_function = function () {
        };
        plugin.init();
    }
    
    $.fn.field_birthday = function (options) {
        
        return this.each(function () {
            
            if (undefined == $(this).data('field_birthday')) {
                var plugin = new $.field_birthday(this, options);
                $(this).data('field_birthday', plugin);
            }
        });
    }
})(jQuery);
