2017-03-22 7 views
0

角度ui-calendarを使用しています。私はイベントをホバリングすると、イベント日付を2017-03-12T04:00:00.000Zと表示します。ここで私はdd-mm-yyyy HH:mm:ssと書式を変更したいと思います。私は私がNEDD何、画像ここui-calendarで日付形式を変更するには?

enter image description here

コードを参照してください言及した画像を添付している: -

.... 
.... 
//loop of n time 
vm.events.push({ title: type, className: ['info'], start: new Date(fulldate), info: res.description + '. Assigned :' + res.assignTo.name }) 
// 
     vm.eventSources = [vm.events]; 

//html code 

    <div class="pos-rlt"> 
        <div class="fc-overlay"> 
         <div class="panel dark-white b-a pos-rlt"> 
          <span class="arrow b-white"></span> 
          <div class="h5 _300 m-b-sm b-b p-b-sm">{{event.title}}</div> 
          <div> 
           <i class="fa fa-fw fa-calendar-o text-muted m-r-xs"></i> {{event.start | date:'medium'}} 
          </div> 
          <div class="ng-hide" ng-show='event.end'> 
           <i class="fa fa-fw fa-clock-o text-muted m-r-xs"></i> {{event.end | date:'medium'}} 
          </div> 
          <div class="ng-hide" ng-show='event.location'> 
           <i class="fa fa-fw fa-map-marker text-muted m-r-xs"></i> {{event.location}} 
          </div> 
          <div class="m-t-sm">{{event.info}}</div> 
          <div class="m-t-sm">{{event.url}}</div> 
         </div> 
        </div> 
        <div calendar="calendar" class="calendar" ng-model="eventSources" ui-calendar="uiConfig.calendar"></div> 
       </div> 

答えて

1

あなたは日付の書式を変更する必要があります。

<div> 
    <i class="fa fa-fw fa-calendar-o text-muted m-r-xs"></i>   
    {{event.start | date:"dd-MM-yyyy HH:mm:ss"}} 
</div> 

<div class="ng-hide" ng-show='event.end'> 
    <i class="fa fa-fw fa-clock-o text-muted m-r-xs"></i> 
    {{event.end | date:"dd-MM-yyyy HH:mm:ss"}} 
</div> 
0

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> 
 
<div ng-app=""> 
 
<p>Few more formats are:</p> 
 
    {{1288323623006 | date:'medium'}} <br> 
 
    {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}} <br> 
 
    {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}} <br> 
 
    {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}} 
 
</div>

完全な参照のためのリンクhttps://docs.angularjs.org/api/ng/filter/date

をご覧ください。
関連する問題