akveo / ngx-admin

Customizable admin dashboard template based on Angular 10+
https://akveo.github.io/ngx-admin/
MIT License
25.29k stars 7.96k forks source link

Bug with calendar and datepicker #5775

Open ArtemRomanovsky opened 4 years ago

ArtemRomanovsky commented 4 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

I just updated our package.json to use the last Nebular version 6.1.0 to see if the bug with the calendar and datepicker component is gone but as you can see from the below screenshot, I still have the same issue

image 2 (1) To replicate simply use: <nb-calendar [showWeekNumber]="true" [date]="myDate (dateChange)="onDateChange($event)">

Where myDate: Date = new Date(); and onDateChange(newStart: Date): void { this.myDate = newStart; }

Moreover, now I have a new this new bug when I click on the Datepicker input: image (3) To replicate: <input type="text" autocomplete="off" nbInput fullWidth name="birthday" id="field_birthday" [disabled]="!canEdit" [nbDatepicker]="birthday" [(ngModel)]="_localCustomer.birthday"> <nb-datepicker #birthday [min]="minDate" [max]="maxDate">

Where: this.minDate = this.dateService.addYear(this.dateService.today(), -120); this.maxDate = this.dateService.addDay(this.dateService.today(), -1);

Moreover, I still have the same question that I already asked since january: are you planning to give the possibility to internationalize Calendar, DatePicker and now the new TimePicker components?

IvanPalekhin-Romanov commented 4 years ago

@ArtemRomanovsky It's strange, beacuse of on Stackblitz it work fine. But in my project (Provided identical package versions), i have the same error.

IvanPalekhin-Romanov commented 4 years ago

I solved this problem with momentjs

            this.min = moment().subtract(1, 'months').startOf('month').toDate();
            this.max = moment().add(1, 'months').endOf('month').toDate();

Using a moment, you can generate a valid date and use it inside your html component with min and max attributes

ArtemRomanovsky commented 4 years ago

@IvanPalekhin-Romanov thanks a lot!

venkatramarajup commented 3 years ago

how to use a single calendar for multiple uses like only for hour, day, month, year, week(must select/highlight 7days), month(must select/highlight the whole month ) in one calendar, instead of many calendars?? @akveo-private