Skip to content

Commit

Permalink
Add API doc and installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
behrang committed Aug 4, 2014
1 parent f82674d commit 51ed7c5
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,59 @@ Jalali calendar is a solar calendar that was used in Persia, variants of which t

Calendar conversion is based on the [algorithm provided by Kazimierz M. Borkowski](http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm) and has a very good performance.

## Install

### Node.js

Use [`npm`](https://npmjs.org) to install:

```sh
$ npm install --save jalaali
```

Then import it:

```js
var jalaali = require('jalaali')
```


### Browser

Use [`component`](https://github.com/component/component) to install:

```sh
$ component install jalaali/jalaali-js
```

Then import it:

```js
var jalaali = require('jalaali')
```

## API

### toJalaali(gy, gm, gd)

Converts a Gregorian date to Jalaali.

### toGregorian(jy, jm, jd)

Converts a Jalaali date to Gregorian.

### isValidJalaaliDate(jy, jm, jd)

Checks whether a Jalaali date is valid or not.

### isLeapJalaaliYear(jy)

Is this a leap year or not?

### jalaaliMonthLength(jy, jm)

Number of days in a given month in a Jalaali year.

### jalCal(jy)

This function determines if the Jalaali (Persian) year is leap (366-day long) or is the common year (365 days), and finds the day in March (Gregorian calendar) of the first day of the Jalaali year (jy).
Expand Down

0 comments on commit 51ed7c5

Please sign in to comment.