Add definitions for 'nunjucks-date'. (#9575)

This commit is contained in:
Lea Hayes
2016-06-08 17:17:48 +09:00
committed by Horiuchi_H
parent 30e180c2c9
commit 36b8b793cc
2 changed files with 28 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="nunjucks-date.d.ts"/>
// Import the plugin
import nunjucksDate = require('nunjucks-date');
// Define a custom default date format. Any valid format works.
// The date format defaults to "YYYY"
// http://momentjs.com/docs/#/displaying/format/
nunjucksDate.setDefaultFormat('MMMM Do YYYY, h:mm:ss a');
let env = { };
// Pass the environment to `install()`
nunjucksDate.install(env);
// Pass the environment & a custom filter name
nunjucksDate.install(env, 'yourFilterName');
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for nunjucks-date
// Project: https://github.com/techmsi/nunjucks-date
// Definitions by: kruncher <https://github.com/kruncher/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "nunjucks-date" {
export function setDefaultFormat(formatString: string): void;
export function install(env: any, filterName?: string): void;
}