2017 © Pedro Peláez
 

library persian-util

image

nimaebrazi/persian-util

  • Thursday, February 9, 2017
  • by nimaebrazi
  • Repository
  • 2 Watchers
  • 3 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PersianUtil

Persian util is simple PHP lib for persian developers., (*1)

Extend

This library extend from:, (*2)

Jalali Date Format V2.65, (*3)

install via composer

Run:, (*4)

composer require nimaebrazi/persian-util

If you need alias in laravel you can include it in config/app.php:, (*5)

'aliases' => [
    ...
    'JCal' => NimaEbrazi\PersianUtil\JalaliDate::class,
    ...
]
Method Example output Description
:-------------: :-------------: :-------------:
toPersianNumber(95) ۹۵ Integer number
toPersianNumber(125.36) ۱۲۵٫۳۶ Double number
toPersianNumber(125.36,'.') ۱۲۵.۳۶ Double number with change float symbol
- - - -
toEnglishNumber(۹۵) 95 Integer or String number
toEnglishNumber(۱۲۵٫۳۶) 125.36 Double or String number
- - - -
getDay() 2 Return number of Jalali day
getMonth() 10 Return number of Jalali month
getYear() 1395 Return number of Jalali year
getPersianDateFormat() 1395/10/2 Return string of Jalali day
- - - -
getDayWord(2) دو Return string of Jalali day
getMonthWord(2) اردیبهشت Return string of Jalali month
getYearWord(1395) هزاروسیصدو نودوپنج Return string of Jalali year
getSeasonWord(10) زمستان Return string of Jalali season of month
getDateWord('1395/2/15') پانزده اردیبهشت هزار و سیصد و نود و پنج Return string of Jalali date
- - - -
isAfterToday('1395/11/2') ('today is: 1395/12/1') false Return bool
isBeforeToday('1395/11/2') ('today is: 1395/12/1') true Return bool
isExpired('1395/11/2') ('today is: 1395/12/1') true Return bool
unixTimestampToJalali(1485342613) 1486984213 Return (string) jalali timestamp
unixTimestampToStrFormat(1485342613) 2017-01-25 14:40:13 Return string of gregorian date with Asia/Tehran timezone
gregorianToJalaliStrFormat(1485342613) 1395/11/6 14:40:13 Return (int) jalali time stamp

The Versions

09/02 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar nimaebrazi

09/02 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar nimaebrazi

25/01 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar nimaebrazi