0

I use nebular datepicker on my project, on backend we just need the date only without hour and min, so we trim the date. but nebular sending the date on iso date format. thats the problem. When I type like Jul 23 2021, the date in my form formated like 2021-07-22T17:00:0000Z On the server, we got 2021-07-22 instead of 2021-07-23 So I need way to solve this? Can I have setting in nebular to disable the iso format ?

ps: i use angular 11, nebular from ngx-admin

Sc from frontend:

Frontend

sc from backend: (Dotnet C#)

Backend

nightingale2k1
  • 10,095
  • 15
  • 70
  • 96

1 Answers1

0

Since you only need a date and not date-time combined I would suggest that you trim the ISO format date to a normal date string like this:

let dateFromInput = "2013-08-03T02:00:00Z";
let newDate = dateFromInput.substring(0, 10);

console.log("dateFromInput ", dateFromInput);
console.log("newDate ", newDate); // 2013-08-03
iftikharyk
  • 870
  • 5
  • 10