Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Paul Sørensen 302 posts 648 karma points
    Jan 28, 2017 @ 17:41
    Paul Sørensen

    datetimepicker databinding problem


    I have created a Datetimepicker and I have problems getting my values back from the controller

    My markup is

    <div class="umb-editor umb-datepicker" ng-controller= "Caddie.DatepickerController" id="matchDate">    
       <div class="input-append date datepicker" style="position: relative;">
             <input name="matchDate" data-format="DD-MM-YYYY" type="text" ng-model="match.matchDate" />
             <span class="add-on">
                 <i data-date-icon="icon-calendar"></i>

    and I have this in my controller

    function applyDate(e) {
        angularHelper.safeApply($scope, function () {
            // when a date is changed, update the model
            var elementData = $element.find("div:first").data().DateTimePicker;
            if (e.localDate) {
               $scope.dateValue = e.localDate.toString("YYYY-MM-DD");

    When the value is changed using the popup my match.matchDate isn't changed, but when I change the value manually it is changed

    Any hints?

    /Paul S

  • Paul Sørensen 302 posts 648 karma points
    Jan 29, 2017 @ 12:51
    Paul Sørensen

    Hi Changed it to use the simpledatepicker and now it works

    <div class="control-group umb-control-group">
        <div class="umb-el-wrap">
             <label class="control-label">Dato</label>
             <div class="controls controls-row">
                <simpledatepicker field="match.matchDate" dateformat = "DD-MM-YYYY" />

    /Paul S

Please Sign in or register to post replies

Write your reply to: