本文整理匯總了TypeScript中shared/momentFactory.MomentFactory.currentDate方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MomentFactory.currentDate方法的具體用法?TypeScript MomentFactory.currentDate怎麽用?TypeScript MomentFactory.currentDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類shared/momentFactory.MomentFactory
的用法示例。
在下文中一共展示了MomentFactory.currentDate方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should return CLAIMANT_ACCEPTED_COURT_PLAN_SETTLEMENT when a claimant has signed a settlement agreement', () => {
claim.claimantResponse = {
type: ClaimantResponseType.ACCEPTATION,
formaliseOption: FormaliseOption.SETTLEMENT,
courtDetermination: {
decisionType: DecisionType.CLAIMANT,
courtDecision: {
paymentDate: MomentFactory.currentDate().add('1 year'),
paymentOption: PaymentOption.BY_SPECIFIED_DATE
},
disposableIncome: 0,
courtPaymentIntention: {
paymentDate: MomentFactory.currentDate().add('6 months'),
paymentOption: PaymentOption.BY_SPECIFIED_DATE
}
},
claimantPaymentIntention: {
paymentDate: MomentFactory.currentDate().add('1 year'),
paymentOption: PaymentOption.BY_SPECIFIED_DATE
}
}
const paymentIntention = {
paymentOption: PaymentOption.BY_SPECIFIED_DATE,
paymentDate: MomentFactory.currentDate()
}
claim.settlement = prepareSettlement(PaymentIntention.deserialize(paymentIntention), MadeBy.CLAIMANT)
claim.respondedAt = MomentFactory.currentDateTime()
expect(claim.status).to.be.equal(ClaimStatus.CLAIMANT_ACCEPTED_COURT_PLAN_SETTLEMENT)
})
示例2: getClaimantPaymentIntention
private static getClaimantPaymentIntention (draftClaimantResponse: DraftClaimantResponse): DomainPaymentIntention {
const claimantPaymentIntention = draftClaimantResponse.alternatePaymentMethod.toDomainInstance()
if (draftClaimantResponse.alternatePaymentMethod.paymentOption.option.value === PaymentOption.IMMEDIATELY) {
claimantPaymentIntention.paymentDate = MomentFactory.currentDate().add(5, 'days')
}
return claimantPaymentIntention
}
示例3: it
it('should return 1 for number of days when interest date starts from yesterday', async () => {
const yesterday = MomentFactory.currentDate().subtract(1, 'days')
const claim: Claim = new Claim().deserialize({ ...sampleClaimObj, issuedOn: yesterday })
const { numberOfDays } = await getInterestDetails(claim) as any
expect(numberOfDays).to.deep.eq(1)
})
示例4: it
it('should use provided values', () => {
const tenDaysAgo = LocalDate.fromMoment(MomentFactory.currentDate().subtract(10, 'days'))
const row: ReportRow = new ReportRow('John Doe', tenDaysAgo)
expect(row.expertName).to.equal('John Doe')
expect(row.reportDate).to.deep.equal(tenDaysAgo)
})
示例5: it
it('should accept affirmed reports with valid data', () => {
const errors = validator.validateSync(new ExpertReports(true, [
new ReportRow('B', LocalDate.fromMoment(MomentFactory.currentDate().subtract(1, 'day')))
]))
expect(errors).to.be.empty
})
示例6: it
it('should return the correct earliest date where defendant pays set date in 50 days but claimant chooses pay by instalment in 55 days', () => {
const claim = prepareClaim(fullAdmissionWithPaymentBySetDateDataPaymentDateAfterMonth)
const claimantPaymentDate: moment.Moment = MomentFactory.currentDate().add(55, 'days')
const paymentDate = getEarliestPaymentDateForPaymentPlan(claim, claimantPaymentDate)
expect(paymentDate.toString()).to.equal(claimantPaymentDate.toString())
})