0

I want to add new type class button in my datepicker.

Example:

  1. Button blue colour for range date from Jan 8, 2014 until Jan 18, 2014

  2. or, button red colour for date Feb 2, 2014.

I already try to ovveride datepicker directive, but it doesn't work. Here my codes:

angular.module('App').directive('NewDatepickerPopup',function(){
return{
    restrict: 'EA',
    replace: true,
    require: ['datepicker'],
    templateUrl: 'template/datepicker/datepicker.html',
    controller: function($scope){
        console.log('controller NewDatepickerPopup');
    },
    link: function(scope, element, attrs, requiredControllers){
        console.log('requiredControllers',requiredControllers);
        console.log('link NewDatepickerPopup');
        element.on('click',function(){
            console.log('on click nya disini');
        });
    }
};

});

angular.module("template/datepicker/datepicker.html", []).run(["$templateCache",
function($templateCache) {
    $templateCache.put("template/datepicker/datepicker.html",
        "<table class=\"zor-datepicker\" >\n" +
        "  <thead>\n" +
        "    <tr>\n" +
        "      <th><button type=\"button\" class=\"btn btn-cal btn-sm pull-left\" ng-click=\"move(-1)\"><i class=\"fa fa-angle-left fa-lg\"></i></button></th>\n" +
        "      <th colspan=\"{{rows[0].length - 2 + showWeekNumbers}}\"><button type=\"button\" class=\"btn btn-cal btn-sm btn-block\" ng-click=\"toggleMode()\">{{title}}</button></th>\n" +
        "      <th><button type=\"button\" class=\"btn btn-cal btn-sm pull-right\" ng-click=\"move(1)\"><i class=\"fa fa-angle-right fa-lg\"></i></button></th>\n" +
        "    </tr>\n" +
        "    <tr ng-show=\"labels.length > 0\" class=\"h6\">\n" +
        "      <th ng-show=\"false\" class=\"text-center ng-hide\">#</th>\n" +
        "      <th ng-repeat=\"label in labels\" class=\"text-center\">{{label}}</th>\n" +
        "    </tr>\n" +
        "  </thead>\n" +
        "  <tbody>\n" +
        "    <tr ng-repeat=\"row in rows\">\n" +
        "      <td ng-show=\"false\" class=\"text-center ng-hide\"><em>{{ getWeekNumber(row) }}</em></td>\n" +
        "      <td ng-repeat=\"dt in row\" class=\"text-center\">\n" +
        "        <button type=\"button\" style=\"width:100%;\" class=\"btn btn-default btn-sm\" ng-class=\"{'btn-info': dt.selected}\" ng-click=\"select(dt.date)\" ng-disabled=\"dt.disabled\"><span ng-class=\"{'text-muted': dt.secondary}\">{{dt.label}}</span></button>\n" +
        "      </td>\n" +
        "    </tr>\n" +
        "  </tbody>\n" +
        "</table>\n" +
        "");
}

]);

<input id="ph" ng-click="openCheckin($event)" name="in" type="text" class="form-control search home" new-datepicker-popup datepicker-popup="{{format}}" ng-model="check_in" ng-change="changeCheckinDate()" is-open="openedCheckin" min="minCheckInDate" ng-required="false" show-weeks="false" show-button-bar="false" close-text="Close" placeholder=""/>    

Anybody could help me?

Thank you so much

*Sorry my english so bad.

1 Answer 1

1

Take a look on this post: https://github.com/angular-ui/bootstrap/issues/743 You could use decorator in the config phase to override the templateUrl

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.