All files / web/bundles/pimui/js pim-datepicker.js

100% Statements 13/13
100% Branches 4/4
100% Functions 4/4
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35396x         396x           6174x   6174x 313x 313x   313x 1565x 1565x 15024x       313x     6174x   6174x          
define(
    ['jquery', 'underscore', 'oro/translator', 'bootstrap.datetimepicker'],
    function ($, _, __) {
        'use strict';
 
        return {
            options: {
                language: 'en',
                pickTime: false
            },
            init: function ($target, options) {
                options = $.extend(true, {}, this.options, options);
 
                if (('en' !== options.language) && (undefined === $.fn.datetimepicker.dates[options.language])) {
                    var languageOptions = {};
                    var defaultOptions = $.fn.datetimepicker.dates.en;
 
                    _.each(_.keys(defaultOptions), function (key) {
                        languageOptions[key] = [];
                        _.each(defaultOptions[key], function (value) {
                            languageOptions[key].push(__('datetimepicker.' + key + '.' + value));
                        });
                    });
 
                    $.fn.datetimepicker.dates[options.language] = languageOptions;
                }
 
                $target.datetimepicker(options);
 
                return $target;
            }
        };
    }
);