How do i extract the time using moment.js?
"2015-01-16T12:00:00"
It should return "12:00:00 pm". The string return will be passed to the timepicker control below.
http://jdewit.github.com/bootstrap-timepicker
Any idea?
How do i extract the time using moment.js?
"2015-01-16T12:00:00"
It should return "12:00:00 pm". The string return will be passed to the timepicker control below.
http://jdewit.github.com/bootstrap-timepicker
Any idea?
This is the good way using formats:
Red more about moment sring format
Use
format
method with a specific pattern to extract the time. Working exampleIf you read the docs (http://momentjs.com/docs/#/displaying/) you can find this format:
See JS Fiddle http://jsfiddle.net/Bjolja/6mn32xhu/
You can do something like this