本文整理匯總了TypeScript中forms/models/localDate.LocalDate.fromMoment方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LocalDate.fromMoment方法的具體用法?TypeScript LocalDate.fromMoment怎麽用?TypeScript LocalDate.fromMoment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類forms/models/localDate.LocalDate
的用法示例。
在下文中一共展示了LocalDate.fromMoment方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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
})
示例2: retrieveDateOfBirthOfDefendant
get retrieveDateOfBirthOfDefendant (): DateOfBirth {
if (this.response && this.response.defendant.type === PartyType.INDIVIDUAL.value) {
const defendantDateOfBirth: Moment = MomentFactory.parse((this.response.defendant as Individual).dateOfBirth)
return new DateOfBirth(true, LocalDate.fromMoment(defendantDateOfBirth))
}
return undefined
}
示例3: 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)
})
示例4: retrieveAndSetValuesInDraft
function retrieveAndSetValuesInDraft (claim: Claim, draft: Draft<DraftCCJ>): Draft<DraftCCJ> {
const paymentOption: CCJPaymentOption = retrievePaymentOptionsFromClaim(claim)
if (paymentOption) {
draft.document.paymentOption = paymentOption
if (paymentOption && paymentOption.option.value === PaymentOption.INSTALMENTS) {
draft.document.repaymentPlan = getRepaymentPlanForm(claim, draft)
} else if (paymentOption && paymentOption.option.value === PaymentOption.BY_SPECIFIED_DATE) {
draft.document.payBySetDate = new PaymentDate(LocalDate.fromMoment(claim.settlement.getLastOffer().paymentIntention.paymentDate))
}
}
return draft
}
示例5: it
it('when payment plan has first payment date in the past', () => {
const draft: ResponseDraft = new ResponseDraft()
draft[admission.type] = new admission.clazz()
draft[admission.type].paymentPlan = new PaymentPlan(
100,
10,
LocalDate.fromMoment(MomentFactory.currentDate().subtract(1,'day')),
PaymentSchedule.EVERY_MONTH
)
expect(YourRepaymentPlanTask.isCompleted(draft[admission.type].paymentPlan)).to.be.false
})
示例6: async
'but payment plan is rejected to be paid BY SET DATE', async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId(claimStoreServiceMock.samplePartialAdmissionWithPaymentBySetDateCompanyData)
draftStoreServiceMock.resolveFind(draftType, {
courtDetermination: undefined,
acceptPaymentMethod: {
accept: {
option: 'no'
}
},
settlementAgreement: {
signed: false
},
alternatePaymentMethod: {
paymentOption: {
option: {
value: 'BY_SPECIFIED_DATE',
displayValue: 'By a set date'
}
},
paymentDate: {
date: LocalDate.fromMoment(MomentFactory.currentDate().add(50, 'days'))
}
},
formaliseRepaymentPlan: {
option: {
value: 'referToJudge',
displayValue: 'Refer to judge'
}
}
})
draftStoreServiceMock.resolveFind('mediation')
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful.withText('Check your answers'))
.expect(res => expect(res).to.be.successful.withText('How would you like the defendant to pay', 'In full by'))
.expect(res => expect(res).to.be.successful.withoutText('Court decision'))
})
示例7: context
context('constructor', () => {
const fiveDaysAgo: LocalDate = LocalDate.fromMoment(MomentFactory.currentDate().subtract(5, 'days'))
it('should use defaults when no parameters given', () => {
const reports: ExpertReports = new ExpertReports()
expect(reports.declared).to.be.undefined
expect(reports.rows).to.have.length(1)
expect(reports.rows[0].expertName).to.be.undefined
expect(reports.rows[0].reportDate).to.be.undefined
})
it('should use provided parameters', () => {
const reports: ExpertReports = new ExpertReports(
true,
[new ReportRow('Mr Blobby', fiveDaysAgo)]
)
expect(reports.declared).to.be.true
expect(reports.rows).to.have.length(1)
expect(reports.rows[0].expertName).to.equal('Mr Blobby')
expect(reports.rows[0].reportDate).to.deep.equal(fiveDaysAgo)
})
})