-
Notifications
You must be signed in to change notification settings - Fork 13
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
In Inline mode not able set date month year or default view #33
Comments
Here is stackblitz code attached https://stackblitz.com/edit/angular-ngmydatepicker ` myDpOptions: IAngularMyDpOptions = { myDateInit: boolean = true; defaultMonth: IMyDefaultMonth ; constructor(private cd : ChangeDetectorRef){ } ngOnInit() {
} trigLast(tenure){ changeDefaultMonthDynamically(): void {
` Html <input class="input-box" placeholder="Click to select a date" angular-mydatepicker name="mydate" (click)="dp.toggleCalendar()" [(ngModel)]="model" [options]="myDpOptions" [defaultMonth]="defaultMonth" #dp="angular-mydatepicker"/>
Last 3 Month
Last 6 Month
Reset
`
<button (click)="changeDefaultMonthDynamically()">change DefaultMonth Dynamically |
Hello @acharyaks90 You can set default view in options as follows: import {IAngularMyDpOptions, DefaultView} from "angular-mydatepicker";
myDatePickerOptions: IAngularMyDpOptions = {
defaultView: DefaultView.Date,
or
defaultView: DefaultView.Month,
or
defaultView: DefaultView.Year,
} |
I fixed this issue. Try version 0.5.2. If you set the defaultMonth and set a date to the model at the same time the model value overrides the defaultMonth value. In this case the visible month is same what are the month and the year in the value of model. The defaultMonth works ok without selected date. |
@kekeh Thank very much quick support. |
In Inline mode not able set date month year or default view to back to some date dynamically for single date mode
I had tried using default month it work for very first time but then it doesn't work.
It works for non inline mode.
in default view not able to understand what type of value is to be given i tried with date and other please give example of that also.
The text was updated successfully, but these errors were encountered: