GithubHelp home page GithubHelp logo

straticjs / stratic-handle-offset Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 124 KB

Return a properly configured MomentJS moment for a Stratic post

License: GNU Lesser General Public License v3.0

JavaScript 100.00%
javascript stratic plumbing hacktoberfest

stratic-handle-offset's Introduction

stratic-handle-offset

Build Status Coverage Status Greenkeeper badge

Return a properly configured MomentJS moment for a Stratic post

Installation

npm install stratic-handle-offset

Usage

All this does is make sure that UTC offset information in Stratic posts is handled properly. This is pretty simple but is easy to forget to do (or to forget the details of how to do) - hence this module.

The module exports a single function. In order to use it, just pass the function the Stratic post's time information object (almost always file.data.time). You will get back a MomentJS moment with the offset information all set up so that when you call moment#month(), moment#year(), etc., everything Just Works™ and you get back accurate information.

Example

var handleOffset = require('stratic-handle-offset');
var through2 = require('through2');

through2.obj(function(file, enc, callback) {
	var date = handleOffset(file.data.time);
	// `date` is now a MomentJS moment; do with that what you will
	// E.g.:

	var year = date.year();
}

Code of Conduct

Please note that StraticJS is developed under the Contributor Covenant Code of Conduct. Project contributors are expected to respect these terms.

For the full Code of Conduct, see CODE_OF_CONDUCT.md. Violations may be reported to [email protected].

License

LGPL 3.0+

Author

AJ Jordan [email protected]

stratic-handle-offset's People

Contributors

greenkeeper[bot] avatar strugee avatar

Watchers

 avatar  avatar

stratic-handle-offset's Issues

An in-range update of perjury is breaking the build 🚨

Version 1.0.11 of perjury was just published.

Branch Build failing 🚨
Dependency perjury
Current Version 1.0.10
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

perjury is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 22 commits.

  • bf66ce4 1.0.11
  • 1055b00 Fix lint errors in test-topic-error.js
  • 1a9fe02 Fix lint errors in test-topic-argument.js
  • aed52e9 Fix lint errors in test-this-callback.js
  • b2be1e3 Fix lint errors in test-promise.js
  • 8b0f755 Fix lint errors in test-multiple-batch.js
  • e69b027 Fix lint errors in test-multiple-batch-async.js
  • 2c45374 Fix lint errors in test-export.js
  • 66677d9 Fix lint errors in test/test-batch-report.js
  • 517d983 Fix lint errors in test/test-asynchronous-callback-arguments.js
  • 3bac772 Fix lint errors in test/test-assert-root.js
  • f10021f Fix lint errors in assert-greater test
  • a5f7b85 Fix lint errors in test/standalone.js
  • 43a72e0 Fix lint errors in async function test
  • bca71e1 Lint errors in lib/suite.js

There are 22 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of perjury is breaking the build 🚨

Version 1.0.4 of perjury was just published.

Branch Build failing 🚨
Dependency perjury
Current Version 1.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

perjury is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • coverage/coveralls First build on greenkeeper/perjury-1.0.4 at 100.0% Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 7 commits.

  • 7bc52f3 1.0.4
  • 29b6921 Keep the test output for a batch with its title; closes #16
  • cdb8a98 Fix package.json syntax error
  • 5fde635 Add CHANGELOG.md
  • 27e0030 Fix typo in compatibility notes
  • 167f1b7 Update package.json engines field
  • cfd7581 Enable Coveralls

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.