Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <div>
  2. <div flex-gt-xs>
  3. <md-datepicker ng-model="myDate" md-placeholder="Enter end date"
  4. md-min-date="minDate" md-max-date="maxDate" ng-change="send1()"></md-datepicker>
  5. </div>
  6. </div>
  7. <script>
  8. (function(scope) {
  9.  
  10. scope.myDate = new Date();
  11.  
  12. scope.minDate = new Date(
  13. scope.myDate.getFullYear(),
  14. scope.myDate.getMonth(),
  15. 15);
  16.  
  17. scope.maxDate = new Date(
  18. scope.myDate.getFullYear(),
  19. scope.myDate.getMonth(),
  20. scope.myDate.getDate());
  21.  
  22.  
  23. })(scope);
  24.  
  25. scope.send1 = function() {
  26.  
  27. if (!this.msg) this.msg = {};
  28.  
  29. if (!this.msg.payload) this.msg.payload = {};
  30.  
  31. this.msg.payload = this.myDate;
  32.  
  33. this.send(this.msg);
  34.  
  35. }.bind(scope);
  36. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement