本文整理汇总了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())
})