本文整理汇总了TypeScript中date-fns/esm.subDays函数的典型用法代码示例。如果您正苦于以下问题:TypeScript subDays函数的具体用法?TypeScript subDays怎么用?TypeScript subDays使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了subDays函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should resort the schedule list when the modal is closed", (): void => {
schedule.id = 999;
schedule.next_due_date = subDays(startOfDay(new Date()), 1);
scheduleIndexController["editSchedule"](1);
$uibModal.close({data: schedule});
(scheduleIndexController.schedules.pop() as ScheduledTransaction).should.deep.equal(schedule);
});
示例2: createScheduledBasicTransaction
function *schedules(count: number): Iterable<ScheduledBasicTransaction> {
for (let id = 1, daysAgo = count + 1; id < count + 1; id++, daysAgo--) {
yield createScheduledBasicTransaction({
id,
next_due_date: subDays(startOfDay(new Date()), daysAgo)
});
}
}
示例3: createBasicTransaction
function *transactions(count: number): Iterable<BasicTransaction> {
for (let id = 1, daysAgo = count + 1; id < count + 1; id++, daysAgo--) {
yield createBasicTransaction({
id,
amount: id,
direction: id % 2 ? "outflow" : "inflow",
transaction_date: subDays(startOfDay(new Date()), daysAgo),
status: id < 5 ? "Cleared" : ""
});
}
}