Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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}}

share|improve this answer
    
Thanks for the idea. –  Derrek Whistle Mar 7 at 19:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.