-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Switching format from 12h to 24h leads to error on picker #198
Comments
Hi. I know about that bug. I've just thought that it's not so neccessary, but I see, that it becames more useful feature. So I'll add possibility to change format dynamically. |
how do you change format? Because I cannot reproduce that bug. Hours list changes as expected |
<ngx-timepicker-field [defaultTime]="currentTimeControl.value" [formControl]="currentTimeControl" [format]="hoursFormat" [toggleIcon]="timePickerIcon"> ts part private setHoursFormat(timeFormat: string) { Sorry I forgot to mention that I am forced to use version 3.3.1 cause of compiler issue:
|
Somehow it looks like the function getHours() is not executed properly @my place.
I copy pasted it to my ts and call it manually.... now it seems to work... I have no idea why it's behaving as it does, because the namespace should not be a problem (getHours shouldn't be overwritten).... ts part private setHoursFormat(timeFormat: string) { private getHours(format: number): ClockFaceTime[] { Can you please put the utils functions into your public api ? So I can reuse them :-) |
Already figured out the issue. Will be fixed soon |
* issue130: + append timepicker to body * * changelog and version * issue203: + set provided min time as the default time if no value is provided * issue204: + configurable style props for editable dial * issue200: + custom buttons for ngx-timepicker-field * issue203: + tests for fromDateTimeToString fn * issue203: + tests for setting min time as a default one * * changelog and version
You can try it now. But you have to use the latest version which is now v5.1.0 |
Thank you! Unfortunately I am not able to test it because we still use Angular 7, that leads to compiler errors (ng s will lead to empty white screen) WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 238:51-69 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 297:56-74 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 323:33-51 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 323:117-125 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 323:153-161 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 323:179-187 WARNING in ./node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js 323:199-207 => I have to wait until we updated to 8.x . So far I simply trust in your development ;) |
Hey guys,
whenever I changed the current format type from 12h to 24h, the picker leads to an error when going > 12 or < 1.
Details
The form starts in the 12h format (hoursFormat=12).
Depending on format settings it's dynamically changed.
<ngx-timepicker-field [defaultTime]="currentTimeControl.value" [formControl]="currentTimeControl" [format]="hoursFormat" [toggleIcon]="timePickerIcon"> </ngx-timepicker-field> <ng-template #timePickerIcon> <span class="my-icon"></span> </ng-template>
Debugging with Augury let me observe, that the amount of available hours is not updated. Initially the array hoursList is an array of 12 elements.
After changing the format, the array is not updated.
I expected the hourList is updated properly on it's own whenever the format is changed (like max. hours does).
The text was updated successfully, but these errors were encountered: