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

TypeScript dateformat.default函数代码示例

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

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



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

示例1: dateFormat

                    .replace(/\$\(date(\:([^\)]+))?\)/i, ($0, $1, $2) => {
                        if ($2) {
                            try {
                                return dateFormat(new Date(), $2);
                            }
                            catch (e) { }
                        }

                        return dateFormat(new Date(), 'isoDateTime')
                    }));
开发者ID:starpeng,项目名称:vscode-file-header-comment-helper,代码行数:10,代码来源:commands.ts


示例2: sendMail

    private static sendMail(letter: Letter, billPath: string, callback: (error: Error) => void) {
        var nodemailer = require("nodemailer");
        var jade = require('jade');
        var dateFormat = require('dateformat');

        var prettyPassedToPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");
        var prettyDispatchedByPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");

        var options = { pretty: true,
            invoiceNumber: letter.invoiceNumber,
            serverPath: Config.getBaseUri()
        };

        jade.renderFile(Config.getBasePath()  + '/views/email.jade', options, function (err, html) {
            if (err) {
                callback(err);
                return;
            }
            // create reusable transport method (opens pool of SMTP connections)
            var smtpTransport = Config.getNodemailerTransport();

            var message = "Please see the HTML Version of this email for more information.";
            // setup e-mail data with unicode symbols
            var mailOptions = {
                from: "[email protected]", // sender address
                to: letter.issuer.email, // list of receivers
                subject: "Mils Billing", // Subject line
                text: message, // plaintext body
                html: html, // html body,
                attachments : [{fileName: 'Invoice.pdf', filePath: billPath}] // TODO: Check whether this is correct
            };

            // send mail with defined transport object
            smtpTransport.sendMail(mailOptions, function(error, response){
                // if you don't want to use this transport object anymore, uncomment following line
                smtpTransport.close(); // shut down the connection pool, no more messages
                callback(error);
            });
        });
    }
开发者ID:arein,项目名称:Mils-Server,代码行数:40,代码来源:BillHelper.ts


示例3: notifyCustomerViaEmail

    public static notifyCustomerViaEmail(letter: Letter, callback: (error: Error) => void) {
        var nodemailer = require("nodemailer");
        var jade = require('jade');
        var dateFormat = require('dateformat');

        var prettyPassedToPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");
        var prettyDispatchedByPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");

        var options = { pretty: true,
            destination: letter.recipient.countryIso,
            passedToPrintingProviderAt: prettyPassedToPrintingProviderAt,
            dispatchedByPrintingProviderAt: prettyDispatchedByPrintingProviderAt,
            serverPath: Config.getBaseUri()
        };

        jade.renderFile(Config.getBasePath()  + '/views/dispatched_email.jade', options, function (err, html) {
            if (err) throw err;
            // create reusable transport method (opens pool of SMTP connections)
            var smtpTransport = Config.getNodemailerTransport();

            var message = "Your letter to " + letter.recipient.countryIso + " from " + prettyPassedToPrintingProviderAt + " was dispatched at " + prettyDispatchedByPrintingProviderAt;
            // setup e-mail data with unicode symbols
            var mailOptions = {
                from: "[email protected]", // sender address
                to: letter.issuer.email, // list of receivers
                subject: "Your Letter was Dispatched", // Subject line
                text: message, // plaintext body
                html: html // html body
            };

            // send mail with defined transport object
            smtpTransport.sendMail(mailOptions, function(error, response){
                // if you don't want to use this transport object anymore, uncomment following line
                smtpTransport.close(); // shut down the connection pool, no more messages
                callback(error);
            });
        });
    }
开发者ID:arein,项目名称:Mils-Server,代码行数:38,代码来源:NotificationManager.ts


示例4: receiveMsg

	/**
	 * メッセージ受け取ったら、DBに格納&全員に送信
	 */
	private receiveMsg(ws: WebSocket, data: any, flags: {binary: boolean}) {
		if (!this.validateMsg(data, flags.binary)) {
			return;
		}
		const log = {
			msg: data,
			date: dateFormat(new Date(), "m/dd HH:MM")
		};
		this.collection.insert(log);
		this.wss.clients.forEach(ws => {
			ws.send(JSON.stringify({
				type: WSResType.log,
				value: log
			}));
		});
	}
开发者ID:sushimaru,项目名称:team-j,代码行数:19,代码来源:chat.ts


示例5: dateFormat

 static dateFormat(date:Date) {
     return dateFormatLib(date, "yyyy-mm-dd");
 }
开发者ID:TrevorVonSeggern,项目名称:game_analytics_spider,代码行数:3,代码来源:tournament.ts


示例6: dateFormatter

function dateFormatter(date:string):string {
    var now = Today.fromNumber(parseInt(date, 10)).toDate();
    return dateFormat(now, "dddd, mmmm dS")
}
开发者ID:m25lazi,项目名称:One-Big-Thing,代码行数:4,代码来源:index.ts


示例7: millisToString

 public millisToString(millis): string {
     let date: Date = this.millisToDate(millis);
     var dateFormat = require('dateformat');
     return dateFormat(date, 'dd.mm.yyyy hh:MM');
 }
开发者ID:Voropash,项目名称:dream-motivation,代码行数:5,代码来源:datesConverter.ts


示例8: dateformat

 transform(value: string, args:string[]): any {
     return dateformat(Date.parse(value), args[0]);
 }
开发者ID:z424brave,项目名称:DKClient,代码行数:3,代码来源:iso-date-pipe.ts


示例9: __log

function __log(category: string, message: string): void {
  let timeString = dateFormat(new Date(), 'yyyy-mm-dd HH:MM:ss.l');
  console.log(`[${timeString}] [${category}] ${message}`);
}
开发者ID:rapidhere,项目名称:rbfs,代码行数:4,代码来源:log.ts


示例10: dateFormat

const now = () => {
  const date = dateFormat(new Date(), '[dd/mm/yyyy hh:MM:ss]')
  return chalk.reset(date)
}
开发者ID:lolPants,项目名称:fancylog,代码行数:4,代码来源:construct.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript datejs.parse函数代码示例发布时间:2022-05-25
下一篇:
TypeScript parse.parse函数代码示例发布时间: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