定制 maarheeze/calendar-date 二次开发

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

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

maarheeze/calendar-date

最新稳定版本:1.1.0

Composer 安装命令:

composer require maarheeze/calendar-date

包简介

a timezone-agnostic calendar date value object

README 文档

README

A timezone-agnostic calendar date value object for PHP. No time component, no timezone concerns.

Requirements

  • PHP 8.2+

Installation

composer require maarheeze/calendar-date

Usage

Creating a date

CalendarDate::today();
CalendarDate::parse('2000-01-01');
CalendarDate::parse('today');
CalendarDate::parse('+3 weeks');
CalendarDate::instance($dateTimeInterface);
CalendarDate::createFromFormat('d-m-Y', '01-01-2000');

Formatting

$date->format('Y-m-d');
$date->__toString(); // defaults to Y-m-d

Arithmetic

$date->addDays(7);
$date->subDays(7);
$date->addMonths(1);
$date->subMonths(1);
$date->addYears(1);
$date->subYears(1);

All arithmetic methods return a new CalendarDate instance.

Comparison

$date->equalTo($other);
$date->isBefore($other);
$date->isAfter($other);
$date->isToday();
$date->isPast();
$date->isFuture();

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-06