Ad Code

Responsive Advertisement

date is not set to the right time in Breezejs

Change your BreezeConfig like that

public class CustomBreezeConfig : BreezeConfig
    {
        protected override JsonSerializerSettings CreateJsonSerializerSettings()
        {
            var settings = base.CreateJsonSerializerSettings();
            settings.DateTimeZoneHandling = DateTimeZoneHandling.Local;
            return settings;
        }
    }

This class will be add same assembly

and add your client side code

breeze.DataType.parseDateFromServer = function (source) {
     var date = moment(source); 
     return date.toDate();   
};

And finally follow the link
http://www.thirdcorner.com/article/managing-breeze-js-your-database-and-timezones-29409
and 
http://stackoverflow.com/questions/17657459/breezejs-date-is-not-set-to-the-right-time

Post a Comment

0 Comments

Close Menu