shahimian/yii2-dategj
Composer 安装命令:
composer require shahimian/yii2-dategj
包简介
it convert Gregorian date to Jalali calendar one.
关键字:
README 文档
README
it convert Gregorian date to Jalali calendar one.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist shahimian/yii2-dategj "*"
or add
"shahimian/yii2-dategj": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by normally:
<?= $dt = \Yii::createObject([ 'class' => \shahimian\dategj\DateGJ::className(), 'datetime' => '2019-09-08 11:56', /* format YYYY-MM-DD HH:MM */ ]); ?>
You can set another value in $dt->datetime later if you want.
Method Details
You use various methods in this class presented in list below:
public string gj()
gets $dt->datetime it formats YYYY-MM-DD HH:MM as Gregorian date and converting that same format as Jalali date.
public Array convertor()
gets argument with upper format and converting as array. it contains 3 cells for year, month and day.
public integer year()
gets argument and returning converted year number.
public integer month()
gets argument and returning converted month number.
public integer day()
gets argument and returning converted day number.
public string month_name($month : integer)
gets month number and returning month name as farsi language.
public string full_date()
return full date contains year, month and day as farsi language.
public string weekday()
return a day of the week as farsi language.
public Array dateSegment()
return Array that is year, month and day for its indeces respectively.
shahimian/yii2-dategj 适用场景与选型建议
shahimian/yii2-dategj 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 09 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「date」 「extension」 「convert」 「Jalali」 「yii2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 shahimian/yii2-dategj 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shahimian/yii2-dategj 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 shahimian/yii2-dategj 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides a simple decimal/roman number converter
A library that provides a simple infrastructure to create your own converters and to perform any conversion you want
Tools to convert between .NET and PHP date formats
A custom URL rule class for Yii 2 which allows to create translated URL rules
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-07