Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Options don't change
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Title:
Options don't change
Miscellaneous
Thread ID:
01658878
Message ID:
01658878
Views:
34
UPDATE. I got the answer in StackOverflow and already solved this issue.

Hi everybody,

I'm trying to figure out the problem.

We have this code (written by my colleague):
/**
     * @type {object}
     */
    Object.defineProperty(DateTimePicker.prototype,
        "OPTIONS",
        {
            get: function () {
                return {
                    useStrict: false,
                    format: this.FORMAT,
                    maxDate: this.MAX_DATE,
                    minDate: this.MIN_DATE,
                    defaultDate: null,
                    viewDate: null,
                    icons: this.ICONS
                };
            }
        });
Somewhere in another place of the code I see this:
if (!this.timeOnly) {
                            let value = services.Date.momentFromDateString(val).format(this.FORMAT);
                            this.OPTIONS.defaultDate = value;
                            this.OPTIONS.viewDate = value;                                
                        }

                        if (!_.isUndefined(this.datetimepicker)) {
                            this.datetimepicker.data("DateTimePicker").destroy();
                            this.datetimepicker = undefined;
                        }

                        this.datetimepicker = this.element.find(".input-group").datetimepicker(this.OPTIONS);
                        this.datetimepicker.data("DateTimePicker").date(val);
However, when I trace that code, the this.OPTIONS.defaultDate remains null despite an attempt to set it. I am thinking the reason is in the code above.

How should it be changed to being able to set the value correctly? We only want to return that set of options with default values when they are not yet set.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform