本文整理汇总了TypeScript中claimant-response/helpers/paydateHelper.getEarliestPaymentDateForPaymentPlan函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getEarliestPaymentDateForPaymentPlan函数的具体用法?TypeScript getEarliestPaymentDateForPaymentPlan怎么用?TypeScript getEarliestPaymentDateForPaymentPlan使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getEarliestPaymentDateForPaymentPlan函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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())
})
示例2: postValidation
postValidation (req: express.Request, res: express.Response): FormValidationError {
const model = req.body.model
if (model.firstPaymentDate) {
const validDate: Moment = getEarliestPaymentDateForPaymentPlan(res.locals.claim, model.firstPaymentDate.toMoment())
if (validDate && validDate > model.firstPaymentDate.toMoment()) {
const error: ValidationError = {
target: model,
property: 'firstPaymentDate',
value: model.firstPaymentDate.toMoment(),
constraints: { 'Failed': 'Enter a date of ' + validDate.format('DD MM YYYY') + ' or later for the first instalment' },
children: undefined
}
return new FormValidationError(error)
}
}
return undefined
}