diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f253ab7 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [guepardoapps@gmail.com]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/COLLABORATING.md b/COLLABORATING.md new file mode 100644 index 0000000..072a29d --- /dev/null +++ b/COLLABORATING.md @@ -0,0 +1,23 @@ +# Collaborator team rules and guidelines for community moderation + +**As a contributor/member of the community, remember that you can always open issues about moderation and problems with how community moderation is done. We are always open to constructive criticism and feedback!** + +## Responsibilities of a collaborator + +As a member of the team that manages **TimeXt-JavaScript**, you have the following responsibilities: + +- **Be part of the conversation in the issue tracker.** That includes (but is not limited to) helping out new members, discussing new features and explaining decisions to people. +- **Review pull requests.** You do not have to read through all of the pull requests and review them, but taking the time each day to review a few can help a great deal. +- **Be civil and polite.** If you are about to lose your temper, take a step back and do something else. We want our interactions with the community to be polite so that more people can join the project and contribute in any way they can. Remember to always thank contributors for their help, even if it's minor changes or changes that did not make it into the project. This way we can reward and encourage people to keep being part of the community. +- **Contribute when you want, moderate when you can.** If you have a lot on your plate outside of this project, it's alright. It's better to take a break for a few days rather than hastily deal with issues and pull requests that might break things. + +## Guidelines for merging pull requests and making changes to the project + +- **[Usual guidelines](CONTRIBUTING.md) apply.** Make sure to follow them, like everybody else. +- **For a pull request to be considered ready to merge, there should be at least 1 (preferably 2) reviews approving it for merge.** There are, however, certain exceptions: + - **If a pull request only fixes typos**, there is no need to wait for a second reviewer (unless you are not certain these were not typos in the first place). + - **If a pull request only clarifies a snippet's description or enforces the style guide for an existing snippet**, you might be able to merge it without getting a second reviewer to review it, but only if you are certain about it. + - **Changes to build scripts, guidelines and things that might break the processes we have in place need to be reviewed by [@GuepardoApps](https://github.com/GuepardoApps)** (this is temporary, but we need a baseline to make sure we break as few things as possible in the beginning). +- **After merging a pull request, make sure to check for untagged snippets and tag them appropriately.** Try to keep all snippets tagged, so that the list and website are up to date. +- **If you make changes or additions to existing snippets or if you want to add your own snippets, you will go through the pull request process that everyone else goes.** Exceptions apply similarly to the ones mentioned above about merging pull requests (i.e. typos, description clarification and the way script and build process changes are handled). Pull requests suggested by collaborators should be reviewed by at least two other collaborators to be considered ready to merge. +- **Pull requests that are inactive for over a week should be closed or put on hold.** \ No newline at end of file diff --git a/README.md b/README.md index 7f51931..3f69638 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Npm](https://img.shields.io/badge/npm-getit-red.svg)](https://www.npmjs.com/package/timext-js) [![Build](https://img.shields.io/badge/build-success-green.svg)](releases/timext-2018-10-28-2.min.js) -[![Version](https://img.shields.io/badge/version-v0.4.0.181028-blue.svg)](releases) +[![Version](https://img.shields.io/badge/version-v0.4.1.190128-blue.svg)](releases) [![CodeCoverage](https://img.shields.io/badge/codeCoverage-98-green.svg)](coverage) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) diff --git a/package.json b/package.json index 3cbc595..b1eda88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timext-js", - "version": "0.4.0", + "version": "0.4.1", "description": "3kB time library to handle date and time more easily", "main": "timext.min.js", "types": "", @@ -53,30 +53,30 @@ ] }, "devDependencies": { - "@babel/cli": "^7.0.0-beta.44", - "@babel/core": "^7.0.0-beta.44", - "@babel/node": "^7.0.0-beta.44", - "@babel/preset-env": "^7.0.0-beta.44", - "babel-core": "^7.0.0-bridge.0", - "babel-jest": "^22.4.3", - "babel-plugin-external-helpers": "^6.22.0", - "cross-env": "^5.1.6", - "eslint": "^4.19.1", - "eslint-config-airbnb-base": "^12.1.0", - "eslint-plugin-import": "^2.10.0", - "eslint-plugin-jest": "^21.26.2", - "gzip-size-cli": "^2.1.0", - "jasmine-core": "^2.99.1", - "jest": "^22.4.3", - "karma": "^2.0.2", - "karma-jasmine": "^1.1.2", - "karma-sauce-launcher": "^1.1.0", - "pre-commit": "^1.2.2", - "rollup": "^0.57.1", - "rollup-plugin-babel": "^4.0.0-beta.4", - "rollup-plugin-uglify": "^3.0.0", - "size-limit": "^0.18.0", - "typescript": "^2.8.3" + "@babel/cli": "7.0.0-beta.44", + "@babel/core": "7.0.0-beta.44", + "@babel/node": "7.0.0-beta.44", + "@babel/preset-env": "7.0.0-beta.44", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "22.4.3", + "babel-plugin-external-helpers": "6.22.0", + "cross-env": "5.1.6", + "eslint": "4.19.1", + "eslint-config-airbnb-base": "12.1.0", + "eslint-plugin-import": "2.10.0", + "eslint-plugin-jest": "21.26.2", + "gzip-size-cli": "2.1.0", + "jasmine-core": "2.99.1", + "jest": "22.4.3", + "karma": "^4.0.0", + "karma-jasmine": "1.1.2", + "karma-sauce-launcher": "^2.0.2", + "pre-commit": "1.2.2", + "rollup": "0.57.1", + "rollup-plugin-babel": "4.0.0-beta.4", + "rollup-plugin-uglify": "3.0.0", + "size-limit": "0.18.0", + "typescript": "2.8.3" }, "dependencies": {} } diff --git a/releases/timext-2019-01-29-1.min.js b/releases/timext-2019-01-29-1.min.js new file mode 100644 index 0000000..d25cc4f --- /dev/null +++ b/releases/timext-2019-01-29-1.min.js @@ -0,0 +1 @@ +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.timext=n()}(this,function(){"use strict";var t=31536e6,n=6048e5,i=864e5,e=36e5,s=function(){function s(t,n){this.val=t,this.unit=n}var o=s.prototype;return o.inYears=function(){return this.val*this.unit/t},o.inWeeks=function(){return this.val*this.unit/n},o.inDays=function(){return this.val*this.unit/i},o.inHours=function(){return this.val*this.unit/e},o.inMinutes=function(){return this.val*this.unit/6e4},o.inSeconds=function(){return this.val*this.unit/1e3},o.inMilliseconds=function(){return this.val*this.unit/1},o.toYears=function(){return new s(this.inYears(),t)},o.toWeeks=function(){return new s(this.inWeeks(),n)},o.toDays=function(){return new s(this.inDays(),i)},o.toHours=function(){return new s(this.inHours(),e)},o.toMinutes=function(){return new s(this.inMinutes(),6e4)},o.toSeconds=function(){return new s(this.inSeconds(),1e3)},o.toMilliseconds=function(){return new s(this.inMilliseconds(),1)},o.plus=function(t){return this.val=(this.inMilliseconds()+t.inMilliseconds())/this.unit*1,this},o.minus=function(t){return this.val=(this.inMilliseconds()-t.inMilliseconds())/this.unit*1,this},o.multiply=function(t){return this.val*=t,this},o.divide=function(t){if(0===t)throw Error("Diversion value may not be 0!");return this.val/=t,this},o.inc=function(){return this.val++,this},o.dec=function(){return this.val--,this},o.compareTo=function(t){return t?this.inMilliseconds()-t.inMilliseconds():this.inMilliseconds()},o.equals=function(t){return!!t&&0===this.compareTo(t)},o.hashCode=function(){return this.inMilliseconds()},o.toString=function(){return this.inMilliseconds().toString()},s}(),o=function(t,n){return new s(t,n)};return Date.prototype.plus=function(t){return new Date(this.getTime()+t.inMilliseconds())},Date.prototype.minus=function(t){return new Date(this.getTime()-t.inMilliseconds())},Number.prototype.toYears=function(){return o(this,t)},Number.prototype.toWeeks=function(){return o(this,n)},Number.prototype.toDays=function(){return o(this,i)},Number.prototype.toHours=function(){return o(this,e)},Number.prototype.toMinutes=function(){return o(this,6e4)},Number.prototype.toSeconds=function(){return o(this,1e3)},Number.prototype.toMilliseconds=function(){return o(this,1)},o});