timepicker: allow two-way binding to something else
See original GitHub issueUsers of timepicker (and, later, datepicker) will amost certainly want to bind the component to a string, a moment, a Date, or some other class that provides more functionality than a simple object with three fields.
I don’t know if the component should provide this functionality (for example by passing a TimeFormat input which would be responsible for transforming the {hour, minute, second}
object to something else and vice-versa), or if this should be done outside of the component. If the latter, a demo demonstrating how to do that would be helpful.
There might be two different needs BTW: creating a new string every time the model changes, and mutating the time part of a moment/Date.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Different behavior when Binding TimePicker and ...
I could reproduce this issue, it looks x:Bind TwoWay model make the binding circular, I can sure it is not by design.
Read more >Implementing Custom Date and Time Picker with 2-way Data ...
This blog explains how we implemented our own custom Date and Time picker with 2-way data binding support using the Data binding framework....
Read more >Xamarin.Forms TimePicker - Microsoft Learn
The Time property has a default binding mode of BindingMode. TwoWay , which means that it can be a target of a data...
Read more >How to Two-way binding in Angular TimePicker component
The following example demonstrates how to achieve two-way binding by binding the value to the first TimePicker component by using property binding and ......
Read more >Two-way data binding - Android Developers
Annotate the method that sets the initial value and updates when the value changes using @BindingAdapter : Kotlin Java More. @BindingAdapter(" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is very probable! Let’s wait for RC5 with the new forms to land and then re-test.
Another possible design is to dependency inject a global service, like you do with the NgbDateParserFormatter (generally, an API will use the same date representation throughout, so configuring this at the application level will usually be enough).
It’s also worth noting that angular/angular#11097 only affects object representations. I happen to only need ISO 8601 strings 😃
This issue is not urgent for me though, because I wrap the NgbInputDatePicker anyway, and have now decorated its ControlValueAccessor and Validator to convert to ISO 8601 and back 😃