角度ui日历没有显示时间

时间:2016-08-09 06:18:28

标签: angularjs ui-calendar

在Angular ui日历中正确显示日期,但没有在事件调度程序中显示时间。在浏览器中,控制台上没有错误,但时间没有显示。我怎样才能在日历上获得时间

angular js file:

dashboard.controller("ReservationController", ['$rootScope', '$scope', '$state', '$location','$http', 'dashboardService', 'Flash',
function ($rootScope, $scope, $state, $location, $http, dashboardService, Flash) {
    var vm = this;
    vm.reservation = {};
    console.log("Reservation");
}]).factory('mmUrl', function($http)
{
  return  $http.get("Youin-api/v2/business/44/view_reservation");          

}).controller('CalendarCtrl',
   function($scope, $rootScope, ngDialog, $compile, $timeout, uiCalendarConfig, $location,$http, dashboardService, Flash,mmUrl) {
   CalendarCtrl = {};
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    var evnt = [];
    $scope.events=[]; 
    $scope.changeTo = 'Hungarian';

    /* event source that calls a function on every view switch */
    $scope.eventsF = function (start, end, timezone, callback) 
    {
         var events ;
         $scope.events=[];
        mmUrl.success(function(data){
             $scope.events = angular.fromJson(data.reservation_list); 

                    callback($scope.events);  
                   });
    };
    $scope.alertOnEventClick = function( date, jsEvent, view){
    var event_id=date.id;
    $http.post("Youin-api/v2/business/event_information",{event_id:event_id}).then(function(response) {
    if(response.data.error="false")
    {
      console.log(response.data);
       document.getElementById("title").value = response.data.title;
       document.getElementById("amount").value = response.data.amount;
       document.getElementById("deal_id").value = response.data.deal_id;
        $('#EventInfo').modal('show');
    }
    }); 
    };

    $scope.changeView = function(view,calendar) {
      uiCalendarConfig.calendars[calendar].fullCalendar('changeView',view);
    };
    $scope.renderCalender = function(calendar) {
      $timeout(function() {
        if(uiCalendarConfig.calendars[calendar]){
          uiCalendarConfig.calendars[calendar].fullCalendar('render');
        }
      });
    };
      $scope.eventRender = function( event, element, view ) {
        element.attr({'tooltip': event.title,
                      'tooltip-append-to-body': true});
        $compile(element)($scope);
    };  
    $scope.uiConfig = {
      calendar:{
        height: 450,
        editable: false,
        allDay: false,
        ignoreTimezone: false,
        header:{
          left: 'title',
          center: 'month',
          right: 'today prev,next'
        },
        eventClick: $scope.alertOnEventClick,
    eventDrop: $scope.alertOnDrop,
        eventResize: $scope.alertOnResize,
        eventRender: $scope.eventRender
      }
    };
      $scope.eventSources = [$scope.events,$scope.eventsF];
      $scope.eventSources2 = [$scope.events,$scope.eventsF];
        });

我的前端:

<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12 padding-right-5 padding-left-5" ng-controller="CalendarCtrl">    
    <div class="" align="left">
   <div class="tab-wrap">  
    <input type="radio" name="tabs" id="tab1" checked ng-click="changeView('month', 'myCalendar3')" >
    <div class="tab-label-content" id="tab1-content">
      <label for="tab1" class="label1">Monthly View</label>
      <div class="tab-content mdl-shadow--4dp">

      <div class="calendar" ng-model="eventSources2" calendar="myCalendar3" ui-calendar="uiConfig.calendar"></div>              
      </div>
    </div>
    <div class="alert-success calAlert" ng-show="alertMessage != undefined && alertMessage != ''">
           <h4>{{alertMessage}}</h4>
     </div>
    <input type="radio" name="tabs" id="tab2" ng-click="changeView('agendaDay', 'myCalendar3')">
    <div class="tab-label-content" id="tab2-content">
      <label for="tab2" class="label1">Daily View</label>
      <div class="tab-content  mdl-shadow--4dp">
      <div class="calendar" ng-model="eventSources" calendar="myCalendar3" ui-calendar="uiConfig.calendar"></div>
   </div>    
    </div>
    <div class="slide"></div>
  </div>          
</div>

 

提前感谢.. !!

0 个答案:

没有答案