本文整理汇总了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())
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:paydateHelper.ts
示例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
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:17,代码来源:repayment-plan.ts
注:本文中的claimant-response/helpers/paydateHelper.getEarliestPaymentDateForPaymentPlan函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论