本文整理汇总了TypeScript中moment.now函数的典型用法代码示例。如果您正苦于以下问题:TypeScript now函数的具体用法?TypeScript now怎么用?TypeScript now使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了now函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updateStartDrinksAtTimestamp
updateStartDrinksAtTimestamp(): void {
const beginningOfDay = moment().startOf('day');
this.startDrinksAtTimestamp.next(beginningOfDay.clone().utc().toJSON());
const msUntilTomorrow = beginningOfDay.clone().add(1, 'day').diff(moment.now());
this.startDrinksAtTimestampCallback = setTimeout(this.updateStartDrinksAtTimestamp.bind(this), msUntilTomorrow);
};
示例2: emailUs
public emailUs(req: any): Promise<any> {
let dt = moment.now();
let dateSentOn= moment.tz(dt, 'America/Chicago').format("MMMM DD, YYYY h:mm a z")
let toCCEmail = process.env.CUSTOMER_CARE_EMAIL
return new Promise((resolve, reject) => {
this.emailHelper.emailUsConfirmationEmail(this.emailHelper.getEmailUsEmail(req,toCCEmail));
resolve({...req.body,txnDateAndTime:dateSentOn})
})
}
示例3: InitializeCharacter
export function InitializeCharacter(statBlock: StatBlock): PersistentCharacter {
return {
Id: statBlock.Id,
Version: statBlock.Version,
Name: statBlock.Name,
Path: statBlock.Path,
LastUpdateMs: now(),
CurrentHP: statBlock.HP.Value,
StatBlock: statBlock,
Notes: ""
};
}
示例4: mapResourcesToCalendar
export function mapResourcesToCalendar(ri: ResourceIndex, unixNow = moment.now()): Calendar {
let x = joinFarmEventsToExecutable(ri);
let calendar = new Calendar();
let addRegimenToCalendar = regimenCalendarAdder(ri);
x.map(function (fe) {
switch (fe.executable_type) {
case "Regimen": return addRegimenToCalendar(fe, calendar);
case "Sequence": return addSequenceToCalendar(fe, calendar);
default: throw new Error(`Bad fe: ${JSON.stringify(fe)}`);
}
});
return calendar;
}
示例5: doneEditing
doneEditing(newLog: Log) {
newLog.date = moment.now();
this.logService.save(newLog)
.subscribe(res => {this.editing = false});
}
示例6: moment
const getMoment = (dt?: any, fmt: string | string[] = MOMENT_FMT): moment.Moment =>
dt ? moment(dt, fmt) : moment(moment.now());
示例7: moment
export const isFutureDate = (input: Date) => {
return moment(input).isAfter(moment.now());
};
示例8: mapStateToProps
export function mapStateToProps(state: Everything): FarmEventProps {
let push = (state && state.router && state.router.push) || (() => { });
let calendar = mapResourcesToCalendar(state.resources.index, moment.now());
let calendarRows = calendar.getAll();
return { calendarRows, push };
}