本文整理汇总了TypeScript中shared/momentFactory.MomentFactory.currentDateTime方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MomentFactory.currentDateTime方法的具体用法?TypeScript MomentFactory.currentDateTime怎么用?TypeScript MomentFactory.currentDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shared/momentFactory.MomentFactory
的用法示例。
在下文中一共展示了MomentFactory.currentDateTime方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it(`should return 0 without calling an API when interest period is 0 days`, async () => {
const interestFromDate = MomentFactory.currentDateTime()
const interestToDate = MomentFactory.currentDateTime()
const amount = await calculateInterest(100, 8, interestFromDate, interestToDate)
expect(amount).to.equal(0)
})
示例2: it
it('should not be eligible when ccjType is Default', () => {
const claim = new Claim()
claim.countyCourtJudgment = {
paymentOption: PaymentOption.IMMEDIATELY,
ccjType: CountyCourtJudgmentType.DEFAULT
} as CountyCourtJudgment
claim.countyCourtJudgmentRequestedAt = MomentFactory.currentDateTime().subtract(20, 'days')
claim.reDeterminationRequestedAt = MomentFactory.currentDateTime()
expect(claim.isEligibleForReDetermination()).to.be.false
})
示例3: it
it('should render page when everything is fine', async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId({
respondedAt: MomentFactory.currentDateTime(),
countyCourtJudgmentRequestedAt: '2017-10-10T22:45:51.785',
countyCourtJudgment: {
defendantDateOfBirth: '1990-11-01',
paidAmount: 2,
paymentOption: 'INSTALMENTS',
repaymentPlan: {
instalmentAmount: 30,
firstPaymentDate: '2018-11-11',
paymentSchedule: 'EVERY_MONTH',
completionDate: '2019-11-11',
paymentLength: '12 months'
},
ccjType: CountyCourtJudgmentType.DETERMINATION
},
claimantResponse: {
type: ClaimantResponseType.ACCEPTATION,
amountPaid: 0
}
})
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful.withText('The repayment plan'))
})
示例4: admissionPayImmediatelyPastPaymentDate
get admissionPayImmediatelyPastPaymentDate (): boolean {
return this.response
&& (this.response.responseType === ResponseType.FULL_ADMISSION || this.response.responseType === ResponseType.PART_ADMISSION)
&& this.response.paymentIntention
&& this.response.paymentIntention.paymentOption === PaymentOption.IMMEDIATELY
&& this.response.paymentIntention.paymentDate.isBefore(MomentFactory.currentDateTime())
}
示例5: it
it('should render page when everything is fine', async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId({
respondedAt: MomentFactory.currentDateTime(),
countyCourtJudgmentRequestedAt: '2017-10-10T22:45:51.785',
countyCourtJudgment: {
defendantDateOfBirth: '1990-11-01',
paidAmount: 2,
paymentOption: 'INSTALMENTS',
repaymentPlan: {
instalmentAmount: 30,
firstPaymentDate: '2018-11-11',
paymentSchedule: 'EVERY_MONTH',
completionDate: '2019-11-11',
paymentLength: '12 months'
},
ccjType: CountyCourtJudgmentType.DETERMINATION
},
reDetermination: {
explanation: 'I feel Defendant can pay earlier and I need money sooner',
partyType: MadeBy.CLAIMANT.value
},
reDeterminationRequestedAt: '2017-10-11T22:45:51.785'
})
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful.withText('Youâve asked for a judge to decide a repayment plan'))
})
示例6: eligibleForCCJ
get eligibleForCCJ (): boolean {
return !this.countyCourtJudgmentRequestedAt
&& (this.admissionPayImmediatelyPastPaymentDate
|| this.hasDefendantNotSignedSettlementAgreementInTime()
|| (!this.respondedAt && isPastDeadline(MomentFactory.currentDateTime(), this.responseDeadline))
)
}
示例7: async
.get(Paths.taskListPage.uri, async (req: express.Request, res: express.Response, next: express.NextFunction) => {
try {
const draft: Draft<ResponseDraft> = res.locals.responseDraft
const draftMediation: Draft<MediationDraft> = res.locals.mediationDraft
const claim: Claim = res.locals.claim
const beforeYouStartSection = TaskListBuilder
.buildBeforeYouStartSection(draft.document, claim, MomentFactory.currentDateTime())
const respondToClaimSection = TaskListBuilder
.buildRespondToClaimSection(draft.document, claim)
const resolvingClaimSection = TaskListBuilder
.buildResolvingClaimSection(draft.document, claim, draftMediation.document)
const directionsQuestionnaireSection = TaskListBuilder
.buildDirectionsQuestionnaireSection(draft.document, claim)
const submitSection = TaskListBuilder.buildSubmitSection(claim, draft.document, claim.externalId, claim.features)
res.render(Paths.taskListPage.associatedView,
{
beforeYouStartSection: beforeYouStartSection,
submitSection: submitSection,
respondToClaimSection: respondToClaimSection,
resolvingClaimSection: resolvingClaimSection,
directionsQuestionnaireSection: directionsQuestionnaireSection,
claim: claim
})
} catch (err) {
next(err)
}
})
示例8: calculateInterest
export async function calculateInterest (amount: number,
interestRate: number,
interestFromDate: Moment,
interestToDate: Moment = MomentFactory.currentDateTime()): Promise<number> {
if (interestToDate.diff(interestFromDate, 'days') > 0) {
return InterestRateClient.calculateInterestRate(amount, interestRate, interestFromDate, interestToDate)
}
return 0
}