Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New Date() saves date 5 hours later
Message
 
 
À
15/04/2015 02:41:38
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01618413
Message ID:
01618446
Vues:
34
>Don't know if it would help but I'd return moment.toDate() in the directive.
>

Tried that to no avail yesterday, but comparing few versions I think I have an idea. I'm going to test it today to see if that change will fix this problem.

UPDATE. Yes, that change fixed the problem.

Here is what I changed:
var format = function (date) {
                        if (date) {
                            if (!pickTime) {
                                if (isEndDate && !onlyFutureDates) {
                                    date = date.hours(23).minutes(59).seconds(59).milliseconds(997);
                                    date = date.format("YYYY-MM-DD HH:mm:ss.SSS").toString();
                                } else {
                                    date = date.hours(0).minutes(0).seconds(0).milliseconds(0);
                                    date = date.format("YYYY-MM-DD HH:mm:ss").toString();
                                }
                            }
                            else
                            {
                                date = date.format("YYYY-MM-DD HH:mm:ss.SSS").toString();
                            }
                        }
                        return date;
                    };
In my previous version the else case was missing and I was using T as a format string. I'm going to verify if that change didn't cause any undesired effects.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform