当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript MomentFactory.parse方法代码示例

本文整理汇总了TypeScript中shared/momentFactory.MomentFactory.parse方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MomentFactory.parse方法的具体用法?TypeScript MomentFactory.parse怎么用?TypeScript MomentFactory.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在shared/momentFactory.MomentFactory的用法示例。


在下文中一共展示了MomentFactory.parse方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should extract the correct state for the claim issued', () => {
      const claim: Claim = new Claim().deserialize({
        ...sampleClaimIssueObj,
        response: {
          responseType: ResponseType.FULL_DEFENCE,
          freeMediation: FreeMediationOption.NO
        },
        settlement: {
          partyStatements: [
            {
              madeBy: 'DEFENDANT',
              type: 'COUNTERSIGNATURE'
            },
            {
              madeBy: 'CLAIMANT',
              type: 'ACCEPTATION'
            },
            {
              type: 'OFFER',
              madeBy: 'DEFENDANT',
              offer: {
                content: 'test',
                completionDate: MomentFactory.parse('2019-05-01')
              }
            }
          ]
        },
        settlementReachedAt: MomentFactory.parse('2019-03-01')
      })

      let claimState = fullDefenceTransitions(claim)
      claimState.findState(claimState)
      expect(claimState.state).to.equal('fd-settled-with-agreement')
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:34,代码来源:full-defence-transitions.ts

示例2: deserialize

  deserialize (input?: any): RepaymentPlan {
    if (input) {
      this.instalmentAmount = input.instalmentAmount
      this.firstPaymentDate = MomentFactory.parse(input.firstPaymentDate)
      this.paymentSchedule = PaymentSchedule.of(input.paymentSchedule)
      if (input.completionDate) {
        this.completionDate = MomentFactory.parse(input.completionDate)
      }
      this.paymentLength = input.paymentLength
    }

    return this
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:13,代码来源:repaymentPlan.ts

示例3: it

      it('should render page when everything is fine and CLAIMANT date is accepted', async () => {
        claimStoreServiceMock.resolveRetrieveClaimByExternalId(defendantFullAdmissionResponse)
        draftStoreServiceMock.resolveFind('claimantResponse', {
          courtDetermination: {
            decisionType: 'CLAIMANT',
            courtDecision: {
              paymentOption: 'BY_SPECIFIED_DATE',
              paymentDate: MomentFactory.parse('2018-11-01'),
              repaymentPlan: undefined }
          },
          alternatePaymentMethod: {
            paymentOption: {
              option: {
                value: 'BY_SPECIFIED_DATE',
                displayValue: 'By set date'
              }
            },
            paymentDate: new PaymentDate(new LocalDate(2018,11,1)),
            paymentPlan: undefined
          }
        })

        await request(app)
          .get(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .expect(res => expect(res).to.be.successful.withText('The defendant can’t pay by your proposed date'))
      })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:27,代码来源:court-offered-set-date.ts

示例4: 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
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:claim.ts

示例5: deserialize

 public deserialize (input: any): CountyCourtJudgment {
   if (input) {
     if (input.defendantDateOfBirth) {
       this.defendantDateOfBirth = MomentFactory.parse(input.defendantDateOfBirth)
     }
     this.paymentOption = input.paymentOption
     this.paidAmount = toNumberOrUndefined(input.paidAmount)
     this.repaymentPlan = input.repaymentPlan ? new RepaymentPlan().deserialize(input.repaymentPlan) : undefined
     this.payBySetDate = input.payBySetDate ? MomentFactory.parse(input.payBySetDate) : undefined
     this.statementOfTruth = new StatementOfTruth().deserialize(input.statementOfTruth)
     if (input.ccjType) {
       this.ccjType = input.ccjType
     }
   }
   return this
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:countyCourtJudgment.ts

示例6: deserialize

 deserialize (input: any): Offer {
   if (input) {
     this.content = input.content
     this.completionDate = MomentFactory.parse(input.completionDate)
     this.paymentIntention = PaymentIntention.deserialize(input.paymentIntention)
   }
   return this
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:offer.ts

示例7: deserialize

  static deserialize (input: any): PaymentIntention {
    if (!input) {
      return input
    }

    const instance = new PaymentIntention()
    instance.paymentOption = input.paymentOption
    instance.paymentDate = input.paymentDate && MomentFactory.parse(input.paymentDate)
    instance.repaymentPlan = input.repaymentPlan && {
      instalmentAmount: input.repaymentPlan.instalmentAmount,
      firstPaymentDate: MomentFactory.parse(input.repaymentPlan.firstPaymentDate),
      paymentSchedule: input.repaymentPlan.paymentSchedule,
      completionDate: input.repaymentPlan.completionDate && MomentFactory.parse(input.repaymentPlan.completionDate),
      paymentLength: input.repaymentPlan.paymentLength
    }

    return instance
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:18,代码来源:paymentIntention.ts

示例8: it

    it('should redirect to ccj error page', async () => {
      idamServiceMock.resolveRetrieveUserFor('1', 'citizen', 'letter-holder')
      claimStoreServiceMock.resolveRetrieveByLetterHolderId(
        '000MC000', { countyCourtJudgmentRequestedAt: MomentFactory.parse('2010-10-10') }
      )

      await request(app)
        .get(Paths.claimSummaryPage.uri)
        .set('Cookie', `${cookieName}=ABC;state = 000MC000`)
        .expect(res => expect(res).to.be.redirect.toLocation(ErrorPaths.ccjRequestedHandoffPage.uri))
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:claim-summary.ts

示例9: it

    it('should convert payment in full by specified date', () => {
      const paymentIntention = PaymentIntention.deserialize({
        paymentOption: { option: PaymentType.BY_SET_DATE },
        paymentDate: { date: new LocalDate(2018,12,31) }
      })

      const result = paymentIntention.toDomainInstance()
      expect(result.paymentOption).to.be.equal('BY_SPECIFIED_DATE')
      expect(result.paymentDate.toISOString()).to.be.deep.equal(MomentFactory.parse('2018-12-31').toISOString())
      expect(result.repaymentPlan).to.be.undefined
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:paymentIntention.ts


注:本文中的shared/momentFactory.MomentFactory.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。