Great solution ajtakrajta!! mine is pretty simpler directive, but can work for anybody:
angular.module(ANGULAR_MODULE)
.directive("datepicker", function () {
return {
restrict: "A",
require: "ngModel",
link: function (scope, elem, attrs, ngModelCtrl) {
var updateModel = function () {
scope.$apply(function () {
ngModelCtrl.$modelValue = elem.val();
});
};
elem.datetimepicker({
useCurrent: false,
minuteStepping:5,
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-arrow-up',
down: 'fa fa-arrow-down'
}
});
elem.on("change",function (e) {
updateModel();
});
}
}
});
And your view would be:
<input type="text" ng-model="item.scheduled_at" datepicker />