當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。