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


TypeScript dateformat.default函数代码示例

本文整理汇总了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: "hello@milsapp.com", // 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: "hello@milsapp.com", // 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;未经允许,请勿转载。