我在AngularJS中使用dhtmlxScheduler,并且正在寻找一种将Date对象转换为字符串的方法。我只关心转换以下app.js代码中的开始日期,而不是结束日期
'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) };
});
有任何想法吗?
如果仅使用字符串显示在网页上,则可以使用日期过滤器
{{date_expression | 日期:日期:格式}}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句