How to convert string HH:MM to Joda Duration?
- by Lucas T
I have a field in a form to state the time duration of an event.
Say, the event is to last 15 mins. So the field will have the following value: 00:15
If it is to last 1 hour: 01:00, etc.
How can I create a Joda Duration object with the string "HH:MM"?
Looking at Joda Time home page, it mentions that it is possible to create a Duration object from specified object using ConverterManager and DurationConverter respectively.
My question is, how can I implement the above interfaces so that I can create a Duration object by passing the a "4:30" parameter?
Thanks in advance,
Lucas