如何从两个日期计算周数 [英] How to calculate weeks from two dates
问题描述
你好朋友,
我想用Angularjs计算两个日期的周末。我试着这样做了。但它不起作用。请给我一些例子。
谢谢,
Ram。
我尝试过:
$ scope.Getweek = function(){
$ scope.month = $ filter('date')($ scope.startOfYear,'MM'); // 12月 - 11月喜欢
$ scope.day = $ filter('date')($ scope.startOfYear, 'DD'); // 01-31喜欢
$ scope.year = $ filter('date')($ scope.startOfYear,'yyyy'); // 2014喜欢
$ scope.startOfYear1 = $ scope.day +'/'+ $ scope.month +'/'+ $ scope.year;
$ scope.ABC =($ scope.startdate - $ scope.startOfYear1 )/ 7;
alert($ scope.ABC);
};
Hello frnds,
I want to calculate no off weeks from two dates using Angularjs. I tried this my way. but its not working. please give me some example.
Thanks,
Ram.
What I have tried:
$scope.Getweek = function () {
$scope.month = $filter('date')($scope.startOfYear, 'MM');//December-November like
$scope.day = $filter('date')($scope.startOfYear, 'dd'); //01-31 like
$scope.year = $filter('date')($scope.startOfYear, 'yyyy');//2014 like
$scope.startOfYear1 = $scope.day + '/' + $scope.month + '/' + $scope.year;
$scope.ABC = ($scope.startdate - $scope.startOfYear1) / 7;
alert($scope.ABC );
};
推荐答案
scope.Getweek = function(){
scope.Getweek = function () {
scope.month =
scope.month =
filter('date')(
filter('date')(
这篇关于如何从两个日期计算周数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!