Download the PHP package meysampg/yii2-intldatebehavior without Composer

On this page you can find all versions of the php package meysampg/yii2-intldatebehavior. 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 yii2-intldatebehavior

Yii2 IntlDateBehavior

🟥⚠️ THIS PACKAGE IS ABANDONED. PLEASE SELECT ANOTHER PACKAGE OR FORK THIS REPOSITORY AND INFORM ME ON p.g.meysam [at] gmail [dot] com TO REFFER TO YOUR PACKAGE IN PACKAGIST ⚠️🟥

Automatic Change Date System of an ActiveRecord After finding It. Actually it converts date and time system just on representation and keep your model clean. So if you need a converter for change time and save it on DB, you can use IntlDate trait ;).

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your class by use meysampg\behaviors\IntlDateBehavior and use it by attaching it as a behavior to your ActiveRecord model:

Also in your model, you must change the rule of timestamp fields from integer to safe.

For default, behavior try to show created_at and updated_at in your desired manner which both of them have timestamp type. If you wanna select other attributes, you can assign them as an array (a.e. ['time1', 'time2', 'time3']) to timestampAttributes property.

Configuration

Configuration of this behavior can be on two way. The first one is using Yii2 configuration array, for example:

This is a local configuration. The second way is when you want to use this behavior in multiple model with same configurations, so you should add it as a behavior to model:

and put the configurations in params.php file. As an example, here is my params.php:

In this way you must assign a value to 'dateTimeFormat' for date time format, 'dateTimeCalendar' calendar system, 'dateTimeLocale' for locale of showing date time information and 'dateTimeZone' for timezone of region where datetime must be shown.

Supported Calendar

Thanks to intldate and intl extension of php, this behavior supports these calendars:

Contributions

Report bugs or do your modification and send a pull request!


All versions of yii2-intldatebehavior with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
meysampg/intldate Version *
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 meysampg/yii2-intldatebehavior contains the following files

Loading the files please wait ....