-
Notifications
You must be signed in to change notification settings - Fork 28
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
Jump on next segment when pressing separator key #26
Conversation
@eight04 Dont know how to write tests for this :-( I have problem with triggering user input. Keyboard events are not exactly what I need to simulate an user input. Also I am not sure how to add leading zeros. I would have to change date before validation somehow. Do you have any idea? Is it ok to merge this PR in this state? |
I think it's pretty hard to test. You can try:
This seems confusing for me. Is there any other datetime widget following this behavior?
👍 |
Wait, I got it. I think we have to cache Then Adding a |
ef76982
to
7913cf0
Compare
Got it working but I am not entirely sure if its done the right way regarding style :-) Basically when Still having problem with writing test :( focusing input doesn't make a selection. If you want to try out I made a separate branch for it: https://github.com/MartinNuc/angular-datetime/tree/jump-on-separator-press-test |
I will try to implement your way. I wanted to avoid global variable so i put error basically in the node itself. Let me try it :-) and thanks for help. |
Indeed much cleaner solution :-) Tried tests in Chrome but its the same :-( If you are fine that its not tested feel free to merge this PR. |
👍 |
Related issue: #25
This PR adds option to jump on the next segment when pressing separator key. For example when filling month in format:
5.7.2016
you can press keys:5
.
7
.
and2016
Still in progress. To-Do:
HH:mm:ss
- when pressing4
and:
on minute segment it should fill04
and jump on seconds