Base solution for your next web application
Open Closed

RAD Tool generated datepicker sending day before selected date #7234


User avatar
0
miroslav.engi created

Hi,

On the form I select for example 14-07-2019 in datepicker and the date sent to API is 13-07-2019. Do I need to configure something on the Angular side (timezone, utc ?) ? I am using ASP.ZERO Asp Core + Angular 7 Version 6.9.

Thanks in advance.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @miroslav.engi

    • Could you share the exact string sent to server as the date value ?
    • Have you set Clock.Provider = ClockProviders.Utc in your app ?

    Thanks,

  • User Avatar
    0
    miroslav.engi created

    Hi,

    The parameter sent to API is deliveryDate: "2019-08-30T00:00:00.000Z" and the date I selected in datepicker is 2019-08-31.

    The clock provider is currently set on the backend. Clock.Provider = ClockProviders.Utc; in the Startup.cs of Web.Host project in public IServiceProvider ConfigureServices(IServiceCollection services) method.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @miroslav.engi

    Thank you for sharing this information. So, if you select 2019-08-31, the value "2019-08-30T00:00:00.000Z" is sent to server, right ?

    I will create an issue on GitHub according to your answer.

    Thanks,

  • User Avatar
    0
    miroslav.engi created

    Hi,

    I am not sure what was the issue, but I deleted the database, ran migration, cleared browser cache, created tenant and set timezone to Central European and now works fine.

    The Clock.Provider = ClockProviders.Utc; is set to UTC.