mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Add definitions for 'nunjucks-date'. (#9575)
This commit is contained in:
@@ -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');
|
||||
Vendored
+11
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user