AngularJS masked datepicker

2 posts, 0 answers
  1. SLM
    SLM avatar
    13 posts
    Member since:
    Oct 2011

    Posted 09 Aug Link to this post

    Hello,

    I'm attempting to create a masked datepicker using AngularJS.

    I tried something like this, but it's not working :

     

    <input kendo-date-picker
    k-mask="00/00/0000"
    k-options="{format: 'dd/MM/yyyy'}"
    ng-model="vm.Filters.ToDate" />

    Do you have a dojo of the solution ?

     

    Thank you.

  2. SLM
    SLM avatar
    13 posts
    Member since:
    Oct 2011

    Posted 09 Aug in reply to SLM Link to this post

    Found a solution/workaround :

    JavaScript :

    mainApp.directive('maskedDatePicker', [function () {
        return {     
            link: function (scope, elem, attrs) {
                $(elem).kendoMaskedTextBox({
                    mask: "00/00/0000"
                });
                $(elem).removeClass("k-textbox");
            }
        }
    }]);

    html :

    <input masked-date-picker
    kendo-date-picker
    k-options="{format: 'dd/MM/yyyy'}"
    ng-model="vm.Filters.ToDate"/>

  3. Kendo UI is VS 2017 Ready
Back to Top