Javascript 如何更改:2018-01-03 21:00:00至1月3日21:00与AngularJs

Javascript 如何更改:2018-01-03 21:00:00至1月3日21:00与AngularJs,javascript,angularjs,angularjs-filter,Javascript,Angularjs,Angularjs Filter,我应该如何使用2018-01-03 21:00:00获得1月3日21:00而不使用年份您可以使用日期管道: API示例: http.get(url).then(function(res) { $scope.data = res.list; angular.forEach($scope.data, function(item) { item.dt_txt = new Date(item.dt_txt); }); }); 您可以使用日期管道: API示例: http.get(

我应该如何使用2018-01-03 21:00:00获得1月3日21:00而不使用年份

您可以使用日期管道:

API示例:

http.get(url).then(function(res) {
  $scope.data = res.list;

  angular.forEach($scope.data, function(item) {
    item.dt_txt = new Date(item.dt_txt);
  });
});

您可以使用日期管道:

API示例:

http.get(url).then(function(res) {
  $scope.data = res.list;

  angular.forEach($scope.data, function(item) {
    item.dt_txt = new Date(item.dt_txt);
  });
});

2018-01-03 21:00:00.11,5;2018-01-03 21:00:00.11,5;我知道这一点,但我的日期包括-,可能这一事实使angularjs崩溃,因为我不能使用你的语法,你自己试试好的,但是你能帮我把它重写为非静态变量吗?我的意思是,我从API得到字符串,需要将它们全部转换,而不是在Js上把每个人都写为变量。使用ng repeatThx,我是beginer,有一些问题。这里是我的代码片段,如果你能写你的解决方案,我知道这一点,但我的日期包括-,可能这个事实会破坏angularjs,因为我不能使用你的语法,你自己试试好的,那很好,但是你能帮我重写这个非静态变量吗。我的意思是,我从API中获取字符串,需要转换所有字符串,而不是在Js上将所有字符串都写入变量。使用ng repeatThx,我是beginer,有一些问题。这里是我的代码片段,如果你能写你的代码的话