Skip to content

Commit

Permalink
docs: update README with simple usage and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainweb committed Sep 24, 2022
1 parent d7f1ebd commit 68e3a0a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](https://img.shields.io/github/release/hussainweb/date-converter.svg?style=flat-square)](https://github.com/hussainweb/date-converter/releases)
[![Software License](https://img.shields.io/badge/license-GPLv2-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/travis/hussainweb/date-converter/master.svg?style=flat-square)](https://travis-ci.org/hussainweb/date-converter)
[![Build Status](https://img.shields.io/github/workflow/status/hussainweb/date-converter/PHP%20tests%20and%20style%20checks?style=flat-square)](https://github.com/hussainweb/date-converter/actions/workflows/test.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/hussainweb/date-converter.svg?style=flat-square)](https://packagist.org/packages/hussainweb/date-converter)

Date Converter is a PHP library to convert dates across various calendars. Currently, support for only various Hijri calendars is planned.
Expand All @@ -11,6 +11,15 @@ Date Converter is a PHP library to convert dates across various calendars. Curre

Via Composer

``` bash
$ composer require hussainweb/date-converter
```bash
composer require hussainweb/date-converter
```

## Usage

To convert between dates, use the respective `Algorithm` class. Similar to [PHP's in-built date conversion functions](https://www.php.net/manual/en/function.gregoriantojd.php), these classes work with Julian Day as a primary means to convert dates.

```php
$algorithm = new HijriFatimidAstronomical();
$hijri_date = $algorithm->fromJulianDay(2457198); // 8-9-1436
```

0 comments on commit 68e3a0a

Please sign in to comment.