Home Format datepicker not change angularjs
Reply: 0

Format datepicker not change angularjs

user1224 Published in July 20, 2018, 5:00 am

i have define the format for my datepicker like this

    $scope.open1 = function() {
    $scope.popup1.opened = true;

  $scope.open2 = function() {
    $scope.popup2.opened = true;
  $scope.formats = ['dd-MMMM-yyyy', 'yyyyMMdd'];
  $scope.format = $scope.formats[1];
  $scope.dt = new Date();
  $scope.dt2 = new Date();
  $scope.popup1 = {
    opened: false

  $scope.popup2 = {
    opened: false

but when i console.log, the result becoming like this

i want something like when i console.log the result will be same as i define. for example Tue Nov 14 2017 into 20171114

here is my .html file

<div class="col-md-2">
        <p class="input-group">
          <input type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dt2" is-open="popup2.opened"/>
          <span class="input-group-btn">
            <button type="button" class="btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311811 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO