Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "j-date", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Date class implementation in Jalali calendar", | ||
"main": "dist/index.js", | ||
"main": "dist/j-date.js", | ||
"scripts": { | ||
"test": "npm test" | ||
"test": "node test.js", | ||
"build": "webpack & webpack --config=webpack.config.dist.js", | ||
"prepublish": "npm run build", | ||
"serve": "webpack -w" | ||
}, | ||
@@ -9,0 +12,0 @@ "repository": { |
# Date class implementation in Jalali calendar | ||
This package aimed to develop and maintain Jalali Calendar also called Persian Calendar in the form of | ||
**JDate aka Date class implementation for Jalali calendar** | ||
This package aimed to develop and maintain Jalaali Calendar also called Persian Calendar in the form of | ||
Javascript Date Class, Basically we have a JDate class with identical interface and behavior of Data class | ||
@@ -12,3 +14,54 @@ | ||
[this code](https://github.com/tahajahangir/jdate) to a modern and modular npm package for ease of use in modern work flow. | ||
## installation | ||
```shel | ||
npm install j-date --save | ||
``` | ||
## usage | ||
using node, webpack, browserify and other commonjs modular environments | ||
```js | ||
var JDate = require('./dist/j-date.src').JDate; | ||
// will log someting like 1394/12/02 03:30:00 | ||
console.log((new JDate('1394-12-2')).toLocaleString()); | ||
``` | ||
```js | ||
// using harmony modules | ||
// default export | ||
import JDate from 'j-date' | ||
// or named export | ||
import { JDate } from 'j-date' | ||
``` | ||
using globals in browser | ||
download dist/j-date.js and load it using script tag | ||
```js | ||
// will log someting like 1394/12/02 03:30:00 | ||
console.log((new JDate('1394-12-2')).toLocaleString()); | ||
``` | ||
## Contribution | ||
Fork this repo and always keep your code on a git branch other than master branch, | ||
### Setting up dev environment | ||
**requirements** | ||
npm 3.*.* or upper | ||
node 4.*.* or upper | ||
```shel | ||
git clone clone git@github.com:you/j-date.git | ||
npm install | ||
npm run serve | ||
``` | ||
run build script to make sure build passes without errors | ||
```shel | ||
npm run build | ||
``` | ||
## TO DO: | ||
@@ -21,4 +74,3 @@ * Writing Tests | ||
* Writing documentation | ||
* Adding minified version | ||
@@ -1,5 +0,5 @@ | ||
var JDate = require('./dist').JDate; | ||
var JDate = require('./dist/j-date.src').JDate; | ||
console.log('JDate should be function', typeof(JDate) === 'function'); | ||
console.log( (new JDate('139۴-12-2')).toLocaleString()); | ||
console.log((new JDate('139۴-12-2')).toLocaleString()); |
@@ -5,3 +5,3 @@ module.exports = { | ||
path: __dirname, | ||
filename: './dist/index.js', | ||
filename: './dist/j-date.src.js', | ||
library: 'JDate', | ||
@@ -8,0 +8,0 @@ libraryTarget: 'umd', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166184
14
4102
74