Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New Date() saves date 5 hours later
Message
 
 
General information
Forum:
Javascript
Category:
Other
Miscellaneous
Thread ID:
01618413
Message ID:
01618446
Views:
38
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform