Skip to content

simple fix to allow override on timezone value #223

@hysterix

Description

@hysterix

Hello,

I am creating an application, and your fork has helped me out a lot. I ran into a small problem, and that was trying to override the default value for timezone wasn't working, it was always defaulting to the hard-coded value, even though I was putting the correct information upon creating the object.

        $('#timet').datetimepicker({
            dateFormat: $.datepicker.RFC_2822,
            hourMin: 03,
            timeFormat: 'hh:mm z',
            timezone: '+0200',
            showTimezone: false
            });

The timezone field wasn't working, I tracked it down and my fix was as follows:

Inside the function _injectTimePicker, add this line:
// override default timezone value
this.timezone = o.timezone;

Before this line, "if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) {"

That should allow you to override the default timezone value. Hope this saves someone else some time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions