eggnukes / yii2-moment
Moment.js和Moment Timezone资源包,适用于Yii2
v1.0.1
2020-05-27 18:42 UTC
Requires
- bower-asset/moment: ~2.0
- bower-asset/moment-timezone: ~0.5
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-09-28 04:35:47 UTC
README
Moment.js(https://moment.js.cn/)和Moment Timezone(https://moment.js.cn/timezone/)资源包,适用于Yii2。
安装
安装此扩展的首选方式是通过composer。
运行以下命令:
php composer.phar require --prefer-dist eggnukes/yii2-moment "*"
或者将以下内容添加到您的composer.json文件的require部分:
"eggnukes/yii2-moment": "*"
to the require section of your composer.json file.
用法
在视图文件中注册所需的资源
\eggnukes\moment\MomentAsset::register($this);
\eggnukes\moment\MomentWithLocaleAsset::register($this);
\eggnukes\moment\MomentTimezoneAsset::register($this);
MomentTimezoneAsset默认依赖于MomentWithLocaleAsset。