Skip to content

Commit

Permalink
Update Documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
Morteza Parvini committed Sep 15, 2018
1 parent 78bf49e commit 7e45ece
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 2 deletions.
97 changes: 96 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,174 +321,269 @@ public function equalsToCarbon(Carbon $carbon): bool
```php
public function greaterThan(Jalalian $other): bool

// $date = Jalalian::now()->greaterThan(Jalalian::now()->subDays(1)))
// output: true
```

---
```php
public function greaterThanCarbon(Carbon $carbon): bool

// $date = Jalalian::now()->greaterThanCarbon(Carbon::now()->subDays(1)))
// output: true

```

---
```php
public function lessThan(Jalalian $other): bool

// $date = Jalalian::now()->lessThan(Jalalian::now()->addDays(1)))
// output: true

```

---
```php
public function lessThanCarbon(Carbon $carbon): bool

// $date = Jalalian::now()->lessThanCarbon(Carbon::now()->addDays(1)))
// output: true

```

---
```php
public function greaterThanOrEqualsTo(Jalalian $other): bool

// $date = Jalalian::now()->greaterThan(Jalalian::now()->subDays(1)))
// output: true

```

---
```php
public function greaterThanOrEqualsToCarbon(Carbon $carbon): bool

// $date = Jalalian::now()->greaterThanOrEqualsToCarbon(Carbon::now()))
// output: true

```

---
```php
public function lessThanOrEqualsTo(Jalalian $other): bool

// $date = Jalalian::now()->lessThanOrEqualsTo(Jalalian::now()))
// output: true

```

---
```php
public function lessThanOrEqualsToCarbon(Carbon $carbon): bool

// $date = Jalalian::now()->lessThanOrEqualsToCarbon(Carbon::now()))
// output: true

```

---
```php
public function isStartOfWeek(): bool

// $date = (new Jalalian(1397, 6, 24))->isStartOfWeek()
// output: true

```

---
```php
public function isSaturday(): bool

// $date = (new Jalalian(1397, 6, 24))->isSaturday()
// output: true

```

---
```php
public function isDayOfWeek(int $day): bool

// $date = (new Jalalian(1397, 6, 24))->isDayOfWeek(0)
// output: true

```

---
```php
public function isEndOfWeek(): bool

// $date = (new Jalalian(1397, 6, 24))->isEndOfWeek()
// output: false

```

---
```php
public function isFriday(): bool

// $date = (new Jalalian(1397, 6, 24))->isFriday()
// output: false

```

---
```php
public function isToday(): bool

// $date = (new Jalalian(1397, 6, 24))->isToday()
// output: (!maybe) true

```

---
```php
public function isTomorrow(): bool

// $date = (new Jalalian(1397, 6, 25))->isTomorrow()
// output: true

```

---
```php
public function isYesterday(): bool

// $date = (new Jalalian(1397, 6, 23))->isYesterday()
// output: true

```

---
```php
public function isFuture(): bool

// $date = (new Jalalian(1397, 6, 26))->isFuture()
// output: true

```

---
```php
public function isPast(): bool

// $date = (new Jalalian(1397, 5, 24))->isPast()
// output: true

```

---
```php
public function toArray(): array

// $date = (new Jalalian(1397, 6, 24))->toArray()
// output: (
// [year] => 1397
// [month] => 6
// [day] => 24
// [dayOfWeek] => 0
// [dayOfYear] => 179
// [hour] => 0
// [minute] => 0
// [second] => 0
// [micro] => 0
// [timestamp] => 1536969600
// [formatted] => 1397-06-24 00:00:00
// [timezone] =>
// )
```

---
```php
public function getDayOfWeek(): int

// $date = (new Jalalian(1397, 5, 24))->getDayOfWeek()
// output: 0

```

---
```php
public function isSunday(): bool

// $date = (new Jalalian(1397, 6, 24))->isSunday()
// output: false

```

---
```php
public function isMonday(): bool

// $date = (new Jalalian(1397, 6, 26))->isMonday()
// output: true

```

---
```php
public function isTuesday(): bool

// $date = (new Jalalian(1397, 6, 24))->isTuesday()
// output: false

```

---
```php
public function isWednesday(): bool

// $date = (new Jalalian(1397, 6, 24))->isWednesday()
// output: false

```

---
```php
public function isThursday(): bool

// $date = (new Jalalian(1397, 6, 22))->isThursday()
// output: true

```

---
```php
public function getDayOfYear(): int

// $date = (new Jalalian(1397, 5, 24))->getDayOfYear()
// output: 179

```

---
```php
public function toString(): string
// $date = (new Jalalian(1397, 5, 24))->isPast()
// output: 1397-05-24 00:00:00

```

---
```php
public function format(string $format): string

// $date = (new Jalalian(1397, 5, 24))->format('y')
// output: 1397
// see php date formats

```

---
```php
public function __toString(): string

// Alias of toString()
```

---
Expand Down
1 change: 0 additions & 1 deletion tests/JalalianTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ public function testModifiers()
$this->assertEquals($jDate->subYears(10)->toString(), (new Jalalian(1387, 1, 31))->toString());
$this->assertTrue($jDate->subYears(2)->subMonths(34)->equalsTo(new Jalalian(1393, 10, 30)));

var_dump(Jalalian::forge('now - 10 minutes')->ago());
}
}

0 comments on commit 7e45ece

Please sign in to comment.