本文整理匯總了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 };
}