문제

I am using dhtmlxScheduler with AngularJS, and I'm looking for a way to convert a Date object to a string. I am only concerned with converting the start date, and not the end date in the following app.js code

   'use strict';

    /* App Module */

    var app = angular.module('schedulerApp', [ ]);

    app.controller('MainSchedulerCtrl', function($scope) {


     $scope.events = [
        { 
          id:1, text:"Task A-12458",

          start_date: new Date(2013, 3, 12), // How would I store this date in a string?

          end_date: new Date(2013, 3, 14) },

     ];

     $scope.scheduler = { date : new Date(2013,10,1) };

     });

Any ideas?

도움이 되었습니까?

해결책

If you are only using the string to display on the web page then you can use the date filter

{{ date_expression | date : date : format}}

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top