javascript - Compare a given Date object to a specific time on the same day -
javascript - Compare a given Date object to a specific time on the same day -
my goal check if specific date object within time frame, , show right button on page result.
currently, have this:
ng-if="payment.transactiondatetime <= *six pm on same day* && payment.transactiondatetime >= *six pm day before payment.transactiondatetime*"
what should create work? need check if payment occured between 6pm day prior transactiondatetime property of payment , 6pm same day transactiondatetimeproperty.
in controller, transaction datetime , create scope variables compare. i'm not sure format have transactiondatetime basic sample code.
if(!payment.transactiondatetime) { var transactionday = new date(date.parse(payment.transactiondatetime)); $scope.beforesixsameday = transactionday.sethours(18); $scope.aftersixdaybefore = new date().setdate(transactionday - 1).sethours(18); }
on html page,
<div ng-if="payment.transactiondatetime <= beforesixsameday && payment.transactiondatetime >= aftersixdaybefore"></div>
javascript angularjs datetime
Comments
Post a Comment