0

I tried to create to dropdown for timepicker using uib-dropdown in angularjs but it does not work. Also, in my input text box, I want to display 09:00:00 instead of Wed Mar 01 2017 09:00:00 GMT-0800 (Pacific Standard Time). Any help please?

plunker here

Thanks

2
  • What part of uib-dropdown isn't working? Commented Mar 2, 2017 at 20:32
  • hi, if you look at the plunker, the dropdown does not work for some reason : embed.plnkr.co/BGI7MKxmRaFWfEykC75B Commented Mar 2, 2017 at 21:01

1 Answer 1

1

Answer to the second part of your question. Use a filter for date formatting.

Add this line of code:

$scope.mytime = $filter('date')(new Date("2017-03-01 09:00:00"), 'mediumTime');

I also added a $watch for the timePicker's model. Find the plunk here.

Sign up to request clarification or add additional context in comments.

2 Comments

it returns Invalid Date on the input
I have assigned a random date to the $scope.timePicker in my plunk, now it no longer says Invalid Date on the input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.