New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Datetime picker defaults to 12 PM instead of 12 AM #3340
Comments
@maxokorokov @pkozlowski-opensource Most of the UI tools out there have 12 AM as the default. Any idea on when the behavior would reverted back from 12 PM to 12 AM? |
Would appreciate a reply on this |
Kindly share an update on this bug. |
Dear team, would appreciate an update on this bug. |
Hello @shyamal890 . ` protected _toNativeDate(date: NgbDateStruct): Date { Ensure to include it in your providers i.e:
See also example: https://ng-bootstrap.github.io/#/components/datepicker/examples#adapter |
@gpolychronis I will try this out and get back here. |
When you use NgbDateNativeUTCAdapter instead of NgbDateNativeAdapter hour is correct (12AM UTC) |
Dear ng-bootstrap team, provide a custom implementation for this adapter is a solution, but why not take 12AM as the default for the |
Bug description:
When one selects a date through
ngb-datepicker
it automatically takes the time as 12PM when it should take 12 AM by default.As seen in the demo below. Given I am in IST timezone (GMT+5:30) when I select say for example 15th Aug, 2019. I get the following output:
2019-08-15T06:30:00.000Z
which is 15th Aug, 2019, 12 PM instead of expected2019-08-14T18:30:00.000Z
which is 15th Aug, 2019, 12 AM.You can also check in
Material
it selects 12 AM: https://stackblitz.com/edit/material-datepicker-12amLink to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/ngb-datepicker-12pm-issue
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 82.3
ng-bootstrap: 5.0.0
Bootstrap: 4+
The text was updated successfully, but these errors were encountered: