What I am trying to to do is when the user selects a specific date, to be able to use that date as a string, put it as data into a JSON object and retrieve data from the database as response.
Selecting the Day I want I am getting this in the console log:
Fri Sep 04 2015 16:15:24 GMT+0300 (GTB Daylight Time)
And in order to use it I want to convert it into this:
20150904
I even used a directive but I suppose this is for a preview only.
.directive('datepickerPopup', function (){
return {
restrict: 'EAC',
require: 'ngModel',
link: function(scope, element, attr, controller) {
//remove the default formatter from the input directive to prevent conflict
controller.$formatters.shift();
}
}
});
Does anyone have a clue how this is going to be done? Thank you in advance!