定制 shahimian/yii2-dategj 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固