vsg24/easydatetime

用 PHP 编写的 Jalali (Shamsi) DateTime 类,抽象化,简单,配置少

v1.0.1 2016-08-30 10:52 UTC

This package is auto-updated.

Last update: 2024-09-13 23:08:57 UTC


README

EasyDateTime 是一个基于 jDateTimePlus 的 Jalali/Shamsi 和公历类,通过抽象化复杂层来简化常见的 DateTime 任务。这可能是 PHP 中解决 Jalali/Shamsi 日历问题的最简单解决方案。

关于此类

EasyDateTime 直接基于 jDateTimePlus 1.0.0,它本身是基于 jDateTime 2.2.0

要求

  • PHP >= 5.4.
  • 由于基于 jDateTimePlus,此包依赖于 jDateTimePlus 1.0.0+

安装

使用 Composer

您可以使用 composer 安装此包。将此包添加到您的 composer.json

"require": {
	"vsg24/easydatetime": "dev-master"
}

或者如果您更喜欢命令行,将目录更改为项目根目录并

php composer.phar require "vsg24/easydatetime":"dev-master"

手动安装

获取包源代码的副本。您可以通过以下两种方式完成此操作

  1. 下载源代码的 ZIP 版本并在所需位置解压
  2. 运行 git clone https://github.com/vsg24/easydatetime.git 以克隆此存储库

获取源代码副本后,只需在需要使用它的位置包含 easydatetime.class.php 即可。

require_once 'path/to/source/easydatetime.class.php';

示例

请参阅 examples.php 或查看 examples-compiled.html 中的示例。

重要提示:如果您想执行更复杂的事情,您可以从 EasyDateTime 对象访问 jDatetimePlus 的实例

$edtObj->$jDatetimePlus

贡献者

许可证

EasyDateTime 由 Vahid Amiri Motlagh 创建并在 MIT 许可证 下发布。

版权所有 (C) 2016 Vahid Amiri Motlagh

The MIT License (MIT)

Copyright (C) 2016 Vahid Amiri Motlagh

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.