AngularJS Datepicker Using JS Files And Reference

AngularJS Datepicker using JS files and reference

Step1

Now we are going see some DatePicker Reference files below .
  1. <script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>  
  2. <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>  
  3. <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>  
  4. <script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>  
Step 2

Here I defined normal input text box and assigned id and ng-model
  1. <label>Licenceexpiry Date</label>  
  2. <input type="text" name="dob" id="DOB" title="dob" ng-model="dob" >  
Step 3

Then call textbox id and assign to datepicker from  below JS code.
  1. <script>  
  2.     $('#dob').datetimepicker({  
  3.         useCurrent: false,  
  4.         format: 'DD/MM/YYYY',  
  5.     });  
  6. </script>  
Just put this scriptag code and mention your text box id and then give format on DD/MM/YYYY or MM/DD/YYYY



I hope this datepicker is mostly helpful for you.
Ebook Download
View all
Learn
View all