aman sharma

aman sharma

  • 1.7k
  • 51
  • 12.9k

date time picker directive in angular js .

Feb 16 2016 1:46 PM
hi ,
 i am stuck .i am  using datepicker directive in .
once i seleted the new date it is working fine but when i want to save the selected date it take current date .
the html for this is like .
<div style="display:none;">
{{card.view_attributes.venue_date.value = info.dateObj.getDate() +' '+ months[info.dateObj.getMonth()] +' '+ info.dateObj.getFullYear()}}
</div>
<div class="col-sm-offset-4 col-lg-offset-4 col-md-offset-4 col-sm-3 col-md-3 col-lg-3 Pl0 venue-card-date-edit" ng-model="info.dateObj " datepicker-popup="dd MMM yyyy" is-open="Opened"
ng-change ="setDate();" date-type="string" >
{{card.view_attributes.venue_date.value}}
</div>
<div class="col-sm-5 col-md-5 col-lg-5 fa fa-calendar" style="text-align:left;margin-top:5px;"
ng-click="Opened=true;$event.stopPropagation(); $event.preventDefault(); ">
</div>
</div>
and in my directive i am creating a javascript dateobject
scope.info = {
dateObj : (new Date())
}
and i want to store the selected date into json value
please reply it . 
 
 
   

Answers (3)