Git Product home page Git Product logo

nunjucks-timezone-aware-datefilter's Introduction

nunjucks-timezone-aware-datefilter · Dependency security

This package provides a date filter, with timezone awareness, for Nunjucks.

It uses Moment.js (a rich date management library) and Moment Timezone, (a timezone-aware extension from and by the maintainers of Moment.js).

Installation

npm install --save nunjucks-timezone-aware-datefilter

Usage

Old (currently still-working) sample call:

var dateFilter = require('nunjucks-date-filter-local');

var env = new nunjucks.Environment();

env.addFilter('date', dateFilter);

Documentation will go here, once the underlying library is refactored.

Credits

This repository is forked from nunjucks-date-filter-local, which itself was forked from nunjucks-date-filter.

The original version (nunjucks-date-filter) provided a wide-ranging callable version of Moment.js' API. The subsequent (nunjucks-date-filter-local) version was created to output dates using local timezones instead of using moment.utc(), and was more recently maintained.

This version adds customizable time zones to the calling structrue, along with a formalized build system with demo and testing features.

What's here?

Here's what each of the files and folders in this repo contain:

Folders

  • ./dist/: The distribution-ready JavaScript in index.js (and a source map for this script in index.js.map).
  • ./examples/: HTML/CSS demonstrations of various filtering functions. These are generated by files in src, described below.
  • ./gulp/: Tasks for the build system. These compile Nunjucks templates and SCSS, as well as packaging the JavaScript that ends up in dist.
  • ./src/: The raw, source code files. Separated into JS (written in ES6 syntax, linted according to the Airbnb JavaScript Style Guide via eslint-config-airbnb), SCSS (compiled into standard CSS by Gulp) and Nunjucks templates (also compiled — and made to work with the date filter — via Gulp).
  • ./test/: Tests for the JavaScript files contained in src. Note: These will need to be reconfigured post-refactor.

Files

  • .babelrc: Configuration for Babel, which transpiles our ES6 code into universally-compliant ES5.
  • .gitignore: A roster of files to be ignored by the version control system.
  • gulpfile.babel.js: The main entry point for the Gulp build system
  • CHANGELOG.md: A running list of changes for each new version.
  • LICENSE: The license for this repository.
  • package.json: The configuration file for this repository's listing on NPM.
  • README.md: This file.

nunjucks-timezone-aware-datefilter's People

Contributors

allanjamesvestal avatar breezewish avatar e-picas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.