Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Options don't change
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Titre:
Options don't change
Divers
Thread ID:
01658878
Message ID:
01658878
Vues:
33
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
Répondre
Fil
Voir

Click here to load this message in the networking platform