Base solution for your next web application
Open Closed

service-proxies.ts toISOString problem #4556


User avatar
0
goldstar25 created

When I send data to the API by service-proxies.ts, I find that the parameters of the moment.Moment type are converted to ISO time when calling the toJSON method, resulting in inconsistent with my current time zone. Can I modify the toJSON method to modify the date formatting rules? E.g

data["subscribeTime"] = this.subscribeTime ? this.subscribeTime.format() : <any>undefined;

Now is :

data["releaseTime"] = this.releaseTime ? this.releaseTime.toISOString() : <any>undefined;

And the server is assigned local time,but clients get the iso time.... Time display is wrong ...


2 Answer(s)
  • User Avatar
    0
    goldstar25 created

    I get NJsonSchema source code from github,and change DateTimeToStringCode is "format()".Build and cover related library. Currently, only this temporary solution is used.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Related github issue <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/760">https://github.com/aspnetzero/aspnet-ze ... issues/760</a>