• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript moment-timezone.default函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中moment-timezone.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: getDate

  protected getDate(date: any, defaultValue: any = null) {
    if (!date) {
      return defaultValue;
    }

    return moment(date)
      .tz(this.timezone)
      .format(DATE_FORMAT);
  }
开发者ID:easygenerator,项目名称:lrs,代码行数:9,代码来源:DataMapper.ts


示例2: diffWithCurrentTime

    function diffWithCurrentTime(team: Team) {
        let currentTime = moment();

        let endTime = moment(team.endQuestDate);


        return endTime.diff(currentTime, 'seconds');
    }
开发者ID:anstarovoyt,项目名称:dmmquest,代码行数:8,代码来源:server.ts


示例3: it

 it('understands cron intervals with a timezone when last run is the same as the interval', () => {
     job.attrs.lastRunAt = new Date('2015-01-01T06:00:00-00:00');
     job.repeatEvery('0 6 * * *', {
         timezone: 'GMT'
     });
     job.computeNextRunAt();
     expect(moment(job.attrs.nextRunAt).tz('GMT').hour()).to.be(6);
     expect(moment(job.attrs.nextRunAt).toDate().getDate()).to.be(moment(job.attrs.lastRunAt).add(1, 'days').toDate().getDate());
 });
开发者ID:cdbajorin,项目名称:typed-agenda,代码行数:9,代码来源:agenda.ts


示例4: downloadEarnings

  public async downloadEarnings(): Promise<void> {
    const date: Date = moment().tz("America/New_York").toDate();
    const dateStr: string = moment().tz("America/New_York").format("YYYY-MM-DD");
    const dateThreshold: Date = moment().add(5, "days").tz("America/New_York").toDate();
    const currentSeason = await this.sql.getSelectedSeason(undefined);
    if (currentSeason === undefined || currentSeason.getEndDate() < date) {
      return;
    }

    const moviesToGet = Enumerable.from(currentSeason.movies)
      .where((m) => m.releaseDate <= dateThreshold)
      .orderByDescending((m) => m.releaseDate)
      .toArray();

    let earnings: Earning[] = [];
    for (const url of currentSeason.urls) {
      const html = await this.http.download(url.url, {});
      const rows = MojoParser.parse(html);
      const earningsToAdd = MojoParser.getEarnings(rows, moviesToGet);
      earnings = earnings.concat(earningsToAdd);
    }

    for (const earning of earnings) {
      const value = accounting.formatMoney(earning.gross, "$", 0);
      this.output.write(`${earning.movie.name}: ${value}\n`);
    }

    await this.sql.deleteEarningsForDate(dateStr);
    const addPromise = this.sql.addEarningsForMovies(earnings);

    this.output.write("\n");

    const ratingsPromises: Array<Promise<void>> = [];
    for (const movie of moviesToGet) {
      if (movie.metacriticUrl === undefined) {
        continue;
      }
      const rating = await this.getRating(movie.metacriticUrl, 0);
      if (rating === undefined) {
        continue;
      }
      ratingsPromises.push(this.sql.updateRatingForMovie(movie, rating));
      this.output.write(`${movie.name}: ${rating}%\n`);
    }

    await addPromise;
    await Promise.all(ratingsPromises);
  }
开发者ID:snickroger,项目名称:FantasyMovieLeague,代码行数:48,代码来源:earningsDownloader.ts


示例5: parse

 parse(value: string): NgbDateStruct {
   const inst: any = moment(value, DATE_FORMAT);
   return {
     year: inst.year(),
     month: inst.month() + 1, // moment return 0-11 for month
     day: inst.date(),
   };
 }
开发者ID:TEAMMATES,项目名称:teammates,代码行数:8,代码来源:session-edit-form-datepicker-formatter.ts


示例6: endDateBeforeRender

    endDateBeforeRender($view, $dates): void {
        if (this.editor.StartDate) {
            const activeDate: moment.Moment = moment(this.editor.StartDate).subtract(1, $view).add(1, "minute");

            $dates.filter(date => date.localDateValue() <= activeDate.valueOf())
                .forEach(date => date.selectable = false);
        }
    }
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:8,代码来源:datetime-form.class.ts


示例7: startDateBeforeRender

    startDateBeforeRender($dates): void {
        if (this.editor.EndDate) {
            const activeDate: moment.Moment = moment(this.editor.EndDate);

            $dates.filter(date => date.localDateValue() >= activeDate.valueOf())
                .forEach(date => date.selectable = false);
        }
    }
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:8,代码来源:datetime-form.class.ts


示例8: format

  format(date: NgbDateStruct): string {
    if (date == null) {
      return '';
    }

    const inst: any = moment();
    inst.set('year', date.year);
    inst.set('month', date.month - 1); // moment month is from 0-11
    inst.set('date', date.day);

    return inst.format(DATE_FORMAT);
  }
开发者ID:TEAMMATES,项目名称:teammates,代码行数:12,代码来源:session-edit-form-datepicker-formatter.ts


示例9: moment

	export const upsertDevice = (memberid: string, device: string): Promise<any> =>

		DeviceTrackingModel.findOneAndUpdate(
			{
				memberid: memberid,
				device: device
			},
			{
				$set: {
					memberid: memberid,
					device: device,
					lastUsed: moment()
				}
			},
			UPSERT_OPTIONS);
开发者ID:roderickmonk,项目名称:rod-monk-sample-repo-ng2,代码行数:15,代码来源:DB.ts


示例10: it

    it("#formattedDate", () => {
        const dateTimeFormClass: DatetimeFormClass = new DatetimeFormClass($scope);
        const dateTime: moment.Moment = moment("2018-12-03");

        expect(dateTimeFormClass.formattedDate(dateTime)).toEqual("3 December 2018");
    });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:6,代码来源:datetime-form.class.spec.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript moment-timezone.duration函数代码示例发布时间:2022-05-25
下一篇:
TypeScript moment-es6.default函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap