npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nunjucks-timezone-aware-datefilter

v0.2.2

Published

A timezone-aware 'date' filter for Nunjucks (using Moment.js and Moment Timezone).

Downloads

10

Readme

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.