承接 symfony_persia/symfonyjdate 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

symfony_persia/symfonyjdate

最新稳定版本:v1.1.12

Composer 安装命令:

composer require symfony_persia/symfonyjdate

包简介

Jalali (Shamsi) DateTime for Symfony2, Supports year higher than 2038

README 文档

README

SensioLabsInsight Latest Stable Version License

Symfony Bundle for converting dates from Gregorian calendar system to Jalali calendar system and vice versa. Supports dates beyond 2038.
Jalali, also known as Shamsi or Hijri Shamsi is the Iranian calendar system. It uses Salar Kaboli's jDateTime class for the conversion.

#Requirements

jDateTime Requires PHP >= 5.2

#Installation

composer require symfony_persia/symfonyjdate 

And then add the package to app/AppKernel.php

#Examples

There is two ways to use this bundle:

##1. As a Twig filter (recommended)

Simply you can filter any variable containing a date, datetime, interval or date string:

{{ entity.date|jdate }} 

Also it's possible to chose the format:

{{ entity.date|jdate('Y-m-d') }} 

##2. As a service

Not recommanded, Maybe neccessary in some situations though.

Example:

$jDate = $serviceContainer->get('symfony_persia.jdate'); 

#Contributors:

##License Symfony JalaliDate Bundle was created by MohammadHossein Heydari and released under the MIT License.

Copyright (C) 2015 MohammadHossein Heydari

jDateTime was created by Sallar Kaboli and released under the MIT License.

Copyright (C) 2015 Sallar Kaboli
Part of Phoenix Framework (p5x.org) by Phoenix Alternatvie

Original Jalali to Gregorian (and vice versa) convertor:
Copyright (C) 2000 Roozbeh Pournader and Mohammad Toossi

The MIT License (MIT) Copyright (C) 2015 MohammadHossein Heydari Copyright (C) 2003-2015 Sallar Kaboli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 2- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 

#Resources

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 61
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04