gpt4 book ai didi

javascript - 如何检查时间是否为00 :00 in my case?

转载 作者:行者123 更新时间:2023-12-03 11:19:21 25 4
gpt4 key购买 nike

我正在尝试alert()如果这个倒计时器{{sale.vtimer |日期:'mm:ss'}} 去了 00:00:

$scope.updateVtimerValue = function (vtimerValue){
$.each(vtimerValue, function(k, v) {
for (var i =0; i < $scope.sales.length ; i ++) {
if($scope.sales[i].orderid == v.orderid){
var nDate = Date.now();
var nTime = Date.parse(v.xtime);
$scope.sales[i].vtimer = nTime - nDate;
}
}
});
}

<tr ng-repeat="sale in sales" ng-cloak>
<td>{{sale.vtimer | date:'mm:ss'}}</td>
</tr>

最佳答案

如果现在与上一帧之间的差异小于或等于 0,则您已达到 00 秒

if($scope.sales[i].vtimer <= 0){
alert("Timer is over");
}

关于javascript - 如何检查时间是否为00 :00 in my case?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27189445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com