本文整理汇总了TypeScript中moment.Moment.date方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Moment.date方法的具体用法?TypeScript Moment.date怎么用?TypeScript Moment.date使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moment.Moment
的用法示例。
在下文中一共展示了Moment.date方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setFirstPaymentDate
function setFirstPaymentDate (firstPaymentDate: Moment): object {
return {
day: firstPaymentDate.date(),
month: firstPaymentDate.month() + 1,
year: firstPaymentDate.year()
}
}
示例2: it
it('should render page with error when DOB is less than 18', async () => {
draftStoreServiceMock.resolveFind('claim')
const date: Moment = MomentFactory.currentDate().subtract(1, 'year')
await request(app)
.post(ClaimPaths.claimantDateOfBirthPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send({ known: 'true', date: { day: date.date(), month: date.month() + 1, year: date.year() } })
.expect(res => expect(res).to.be.successful.withText('Please enter a date of birth before', 'div class="error-summary"'))
})
示例3: removeHoursAndMinutes
private static removeHoursAndMinutes(dateTime: Moment): Moment {
const date = moment(new Date(
dateTime.year(),
dateTime.month(),
dateTime.date()
))
return date
}
示例4: dataToSend
function dataToSend (firstPaymentDate: Moment): object {
return {
totalAmount: 100,
instalmentAmount: 50,
firstPaymentDate: {
day: firstPaymentDate.date(),
month: firstPaymentDate.month() + 1,
year: firstPaymentDate.year()
},
paymentSchedule: 'EVERY_MONTH'
}
}
示例5: date
public date(): number {
return this.moment.date()
}