定制 sorkh.shahin/jalalicalendar 二次开发

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

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

sorkh.shahin/jalalicalendar

Composer 安装命令:

composer require sorkh.shahin/jalalicalendar

包简介

Jalali Calendar

README 文档

README

A php native-like package for use of Persians and everyone who uses Jalali calendar and wants to get rid of Arabic characters in their php applications.

Installation

You can use composer to install this calendar

$ composer require sorkh.shahin/jalalicalendar

Usage

This package is under ShSo\Jalali namespace and does two things:

  1. Provides Jalali date/time using ShSo\Jalali\DateTime class
  2. Converts English and Arabic numbers to Persian and vice versa using ShSo\Jalali\Converter class

How to use

All methods and functionalities are static methods of the classes ShSo\Jalali\DateTime and ShSo\Jalali\Converter

ShSo\Jalali\DateTime provides:

  • date() Jalali equivalent of php native date() function with options to choose whether use Persian numbers and choose different timezone
  • strftime() Jalali equivalent of php native strftime() function with options to choose whether use Persian numbers
  • mktime() Jalali equivalent of php native mktime() function
  • checkdate() Jalali equivalent of php native checkdate() function
  • getdate() Jalali equivalent of php native getdate() function
  • gregorianToJalali() Converts Gregorian date to Jalali
  • jalaliToGregorian() Converts Jalali date to Gregorian
  • dayOfYear() Returns number of passed days since the start of the year, dayOfYear(6,8) returns 163
  • isLeapYear() Returns true if the given year is leap or false otherwise
  • dayOfMonth() Returns number of days in the month, dayOfMonth(12,1395) returns 30
  • getMonthName() Returns the name of the month, whether in full or short and in Persian or English
  • getWeekName() Returns day of week in Gregorian order whether in Persian or English
  • getShortWeekName() Returns day of week in Gregorian order in 3 letters whether in Persian or English

ShSo\Jalali\Converter provides:

  • numToPersian() Converts all numbers whether in English or Arabic to Persian
  • numToEnglish() Converts all numbers whether in Arabic or Persian to English
  • arabicToPersian() Converts ('ي', 'ك', 'ة') to ('ی', 'ک', 'ه') and ('٤', '٥', '٦') to ('۴', '۵', '۶')

License

This package is under MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固