Download the PHP package majidcode/easy-jalali without Composer

On this page you can find all versions of the php package majidcode/easy-jalali. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package easy-jalali

Easy Jalali for PHP V1.0.0

How to install:

Note: this library has been tested in Laravel 8.x and Laravel 9.x.

How to use:

1. Create your date from original format:

Create a date with one of the fromJalali(), fromGeorgian() or fromCarbon() methods.

Example:

2. Convert to your format:

You can use toGeorgian() or toJalali() functions to convert your date.

Example:

3. Get your result or format:

You can use PHP date formats and Jalali dates is like PHP but has been changed or not supported in some cases.

Example:

Example codes:

I have provided some examples in ./example folder that you are easy to use!

Documention:

Supported format characters:

Key For What? Supported in Georgian Supported in Jalali Example returned values
Y A full numeric representation of a year, 4 digits + Yes + Yes Examples: 2021, 1401
y A two digit representation of a year + Yes + Yes Examples: 21 or 01
m Numeric representation of a month, with leading zeros + Yes + Yes 01 through 12
n Numeric representation of a month, without leading zeros + Yes + Yes 1 through 12
F A full textual representation of a month, such as January or March + Yes + Yes January through December - فروردین through اسفند
d Day of the month, 2 digits with leading zeros + Yes + Yes 01 to 31
j Day of the month without leading zeros + Yes + Yes 1 to 31
a Lowercase Ante meridiem and Post meridiem + Yes + Yes am or pm - ق.ظ or ب.ظ
A Uppercase Ante meridiem and Post meridiem + Yes + Yes AM or PM - قبل از ظهر or بعد از ظهر
H 24-hour format of an hour with leading zeros + Yes + Yes 00 through 23
h 12-hour format of an hour with leading zeros + Yes + Yes 01 through 12
G 24-hour format of an hour without leading zeros + Yes + Yes 0 through 23
g 12-hour format of an hour without leading zeros + Yes + Yes 1 through 12
i Minutes with leading zeros + Yes + Yes 00 to 59
s Seconds with leading zeros + Yes + Yes 00 through 59
M A short textual representation of a month, three letters + Yes - No Jan through Dec
D A textual representation of a day, three letters + Yes - No Mon through Sun
l A full textual representation of the day of the week + Yes - No Sunday through Saturday
N ISO 8601 numeric representation of the day of the week + Yes - No 1 (for Monday) through 7 (for Sunday)
S English ordinal suffix for the day of the month, 2 characters + Yes - No st, nd, rd or th. Works well with j
w Numeric representation of the day of the week + Yes - No 0 (for Sunday) through 6 (for Saturday)
z The day of the year (starting from 0) + Yes - No 0 through 365
W ISO 8601 week number of year, weeks starting on Monday + Yes - No Example: 42 (the 42nd week in the year)
t Number of days in the given month + Yes - No 28 through 31
L Whether it's a leap year + Yes - No 1 if it is a leap year, 0 otherwise.
--- Other Official PHP date formats + Yes - No Check PHP Document

Input Functions:

Function Name Inputs
fromJalali() String $JalaliDate: Jalali datetime string, String $format (default: 'Y-m-d H:i:s'): Jalali datetime format
fromGeorgian() String $georgianDate: Georgian datetime string, String $format (default: 'Y-m-d H:i:s'): Georgian datetime format
fromCarbon() Carbon $carbon: Carbon DateTime

Convert Functions:

Function Name For what? Requirement
toJalali() To convert your date to Jalali calender Using after fromGeorgian() or fromCarbon()
toGeorgian() To convert your date to Georgian calender Using after fromJalali()

Output Functions:

Function Name Input Return
toFormat() String $format (default: 'Y-m-d H:i:s'): Datetime format based on your date type String $resultDateByFormat: DateTime based on your $format from input
year() --- $year
month() --- $month
day() --- $day
hour() --- $hour
minute() --- $minute
second() --- $second

All versions of easy-jalali with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
nesbot/carbon Version ^2.57
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package majidcode/easy-jalali contains the following files

Loading the files please wait ...