定制 irpug/facal 二次开发

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

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

irpug/facal

最新稳定版本:v0.1

Composer 安装命令:

composer require irpug/facal

包简介

Create and Print Persian datetime based on standard DateTime and Carbon

README 文档

README

Latest Version Software License

A collection of Persian date/time utilities to get and print DateTime Object in Persian formats based on Carbon, \DateTime and IntlCalendar.

Requirements

Install

Via Composer

$ composer require irpug/facal

Usage

ini_set('intl.default_locale', 'fa_IR');

require 'vendor/autoload.php';

use IrPUG\FaCal\Lib\PersianDateTime;
use IrPUG\FaCal\Lib\PersianCarbon;
use IrPUG\FaCal\FaCalUtils;

$date = new PersianDateTime();
$date->setPersianDate(1394, 2, 2);

var_dump($date);


var_dump(FaCalUtils::printDateTime($date, FaCalUtils::FULL));
var_dump(FaCalUtils::printDateTime($date, FaCalUtils::SHORT));
var_dump(FaCalUtils::printDateTime($date, FaCalUtils::NONE));
var_dump(FaCalUtils::printDateTime($date, FaCalUtils::LONG));
var_dump(FaCalUtils::printDateTime($date, FaCalUtils::MEDIUM));
var_dump(FaCalUtils::printDateTime($date, "EEEE, d 'of' MMMM y"));
var_dump(FaCalUtils::getYear($date));
var_dump(FaCalUtils::getMonthNum($date));
var_dump(FaCalUtils::getMonthName($date));
var_dump(FaCalUtils::getWeekdayName($date));
var_dump(FaCalUtils::getWeekdayNum($date));
var_dump(FaCalUtils::getQuarter($date));

var_dump(PersianCarbon::createFromPersianDate(1394, 1, 1)->addDay());
var_dump(FaCalUtils::printDateTime(PersianCarbon::createFromPersianDate(1394, 1, 1)->addDay(), FaCalUtils::FULL));
var_dump(PersianCarbon::createFromPersianDate(1393, 12, 28)->diffForHumans());

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-29