DatePicker “eats” a day when parsing from model to Date then back to model again

Bug description:

When using NgbDateParserFormatter to parse the date from a timestamp to iso string, the calendar
sets the actual date to a day before

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/88wXfUYWQyRvTY5xAbHA?p=preview (select today using the buttons, watch the variables)

Version of Angular, ng-bootstrap, and Bootstrap:

Angular:
“@angular/core”: “^4.0.0”,

ng-bootstrap:
“@ng-bootstrap/ng-bootstrap”: “^1.0.0-alpha.20”,

Bootstrap:
“bootstrap”: “4.0.0-alpha.6”,

1 possible answer(s) on “DatePicker “eats” a day when parsing from model to Date then back to model again

  1. @moshmage what “eats” a day is data manipulation / conversion that you are using, specifically this code: new Date(this.dateModel).toISOString();. Check this plunk: http://plnkr.co/edit/7BznYBGYlc6XWxkYTEcn?p=preview

    Please note that the NgbDateISOParserFormatter only parses dates from string, that is, it only looks into / understands this part: 2017-04-19. It is not aware nor concerned with times and time zones. Once again, this is a datepicker not the absolute time picker.