2

i have date like sat Nov 15 2014 i want to convert this date in 15/11/2014 and i am using.

$filter('date')($scope.visa.rdate, 'dd/MM/yyyy');

but it's not working.

3
  • Have a look at the answers to this question: Format Date time in Angular JS Commented Nov 15, 2014 at 9:20
  • are you ok to use moment.js?? Commented Nov 15, 2014 at 10:37
  • it's not working is not a proper problem statement. What does happen and what errors are thrown (if any)? Commented Nov 15, 2014 at 13:37

1 Answer 1

0

Convert $scope.visa.rdate (looks like it's a string) to Date object before you pass it into $filter:

$filter('date')(new Date($scope.visa.rdate), 'dd/MM/yyyy');
Sign up to request clarification or add additional context in comments.

4 Comments

What is $scope.visa.rdate exactly?
$scope.visa.rdate ia a viariable who holds the value of date which is in sat Nov 15 2014 format but i want to cahnge it in 15/11/2014.
$scope.visa.rdate = Sat Nov 15 2014 00:00:00 GMT+0530 (IST)
Works for me. What is the result for you?

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.