svfnix / symfonyjdate
适用于 Symfony3 的 Jalali (Shamsi) 日期时间,支持2038年以后的年份
dev-master
2017-08-29 05:50 UTC
Requires
- php: >=5.2.0
This package is not auto-updated.
Last update: 2024-09-15 02:21:59 UTC
README
Symfony Bundle,用于将公历日期时间转换为贾利历日期时间,反之亦然。支持2038年以后的日期。
贾利历,也称为Shamsi或Hijri Shamsi,是伊朗日历系统。它使用Salar Kaboli的jDateTime类进行转换。
#要求
jDateTime 需要 PHP >= 5.2
#安装
composer require svfnix/symfonyjdate
然后将其包添加到app/AppKernel.php
#示例
使用此包有两种方式
##1. 作为 Twig 过滤器(推荐)
您可以直接过滤包含日期、日期时间、间隔或日期字符串的任何变量
{{ entity.date|jdate }}
也可以选择格式
{{ entity.date|jdate('Y-m-d') }}
##2. 作为服务
不推荐,尽管在某些情况下可能需要。
示例
$jDate = $serviceContainer->get('symfony_persia.jdate');
#贡献者
- MohammadHossein Heydari
- Sallar Kaboli
- Omid Pilevar
- Afshin Mehrabani
- Amir Latifi
- Ruhollah Namjoo
- Saeed Vasheghani Farahani
##许可证 Symfony JalaliDate Bundle 由 MohammadHossein Heydari 创建,并使用 MIT 许可证 发布。
版权 (C) 2015 MohammadHossein Heydari
jDateTime 由 Sallar Kaboli 创建,并使用 MIT 许可证 发布。
版权 (C) 2015 Sallar Kaboli
是 Phoenix 框架(p5x.org)的一部分,由 Phoenix Alternatvie 提供
原始的贾利历到公历(反之亦然)转换器
版权 (C) 2000 Roozbeh Pournader 和 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.
#资源