xdan / periodpicker

Empty repository for paid periodpicker version
14 stars 2 forks source link

Only one month cell appearing, despite using cells[1,3] #49

Closed richbenwell closed 7 years ago

richbenwell commented 8 years ago

Issue When showing timepicker and default cells (height=1, width=3) only one month "cell" is shown.

Version 5.1.6

Code

jQuery('#datetimepicker').periodpicker({
    timepicker: true
});

Additional details

Looking at the code, it seems that this function is related to the issue. The argument cells is never defined and that.pickerdays.width() returns 0, causing cells to be set to [1,1]

PeriodPicker.prototype.regenerate = function (cells) {
        //...
        var that = this,
            width = parseInt(that.pickerdays.width(), 10),
            height = parseInt(that.picker[0].offsetHeight, 10),
            i;
        //...
        if (cells === undefined) {
            this.options.cells = [Math.floor((height - that.options.someYOffset) / that.options.monthHeightInPixels) || 1, Math.floor(width / that.options.monthWidthInPixels) || 1];
        }
xdan commented 7 years ago

Fixed. Please download latest version http://xdsoft.net/jqplugins/periodpicker/?update#plugin_sender

richbenwell commented 7 years ago

Thanks!