how to get weekday in number from date in angularJS binding -


i want "day of week" specific date in angular binding. expected result like:

date=07/26/2017  above date day "wednesday" expected result "3" b'coz above date weekday "3" 

you can try this:

var t = new date('07/26/2017') t.getday() // return 3 

this working snippet:

var app = angular.module("myapp", []);  app.controller("myctrl", function($scope) {      $scope.mydate = '07/26/2017';  });    app.filter('customdate', function() {    return function(input) {      var t = new date(input);      return t.getday();    }  });
<!doctype html>  <html>  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>    <body>      <div ng-app="myapp" ng-controller="myctrl">      {{mydate|customdate}}    </div>


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -