madand/yii2-momentjs

moment asset for Yii2

Installs: 11 188

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 4

Type:yii2-extension

dev-master 2015-11-19 11:54 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:16:57 UTC


README

Provides the asset bundle for easy integration of moment into your Yii2 application.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist "madand/yii2-momentjs:*"

or add

"madand/yii2-momentjs": "*"

to the require section of your composer.json file.

Usage

In the view file register the asset:

// Register only core momentjs with no locale data
\madand\momentjs\MomentJsAsset::register($this);

// Register core momentjs with current app locale. Current locale is activated on DOM ready.
\madand\momentjs\MomentJsLocaleAsset::register($this);

// Register core momentjs with all locales supported by the momentjs.
\madand\momentjs\MomentJsAllLocalesAsset::register($this);

License

The BSD License (BSD). Please see License File for more information.