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


TypeScript moment.now函数代码示例

本文整理汇总了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);
  };
开发者ID:adamstegman,项目名称:drank,代码行数:7,代码来源:drinks.service.ts

示例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})
   })
 }
开发者ID:bbachi,项目名称:Angular5Sample,代码行数:9,代码来源:cc.helper.ts

示例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: ""
    };
}
开发者ID:zipzav,项目名称:improved-initiative,代码行数:12,代码来源:PersistentCharacter.ts

示例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;
}
开发者ID:MrChristofferson,项目名称:Farmbot-Web-API,代码行数:15,代码来源:map_state_to_props.ts

示例5: doneEditing

 doneEditing(newLog: Log) {
     newLog.date = moment.now();
     this.logService.save(newLog)
             .subscribe(res => {this.editing = false});
 }
开发者ID:florendg,项目名称:igjava-webworkshop,代码行数:5,代码来源:app.ts

示例6: moment

const getMoment = (dt?: any, fmt: string | string[] = MOMENT_FMT): moment.Moment =>
  dt ? moment(dt, fmt) : moment(moment.now());
开发者ID:magmacomputing,项目名称:whiteBook,代码行数:2,代码来源:date.library.ts

示例7: moment

export const isFutureDate = (input: Date) => {
    return moment(input).isAfter(moment.now());
};
开发者ID:mthmulders,项目名称:hyperion-web,代码行数:3,代码来源:dates.ts

示例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 };
}
开发者ID:MrChristofferson,项目名称:Farmbot-Web-API,代码行数:6,代码来源:map_state_to_props.ts


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