定制 rebeccathedev/episcopaldate 二次开发

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

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

rebeccathedev/episcopaldate

Composer 安装命令:

composer require rebeccathedev/episcopaldate

包简介

A modern PHP 8.1+ library for handling dates in the Episcopal Church USA (the American branch of the worldwide Anglican Communion). As a Western Christian tradition, many of these functions are suitable for use in other denominations as well.

README 文档

README

A modern PHP 8.1+ library for handling dates in the Episcopal Church USA (the American branch of the worldwide Anglican Communion). As a Western Christian tradition, many of these functions are suitable for use in other denominations as well.

📦 Installation

composer require rebeccathedev/episcopaldate

Requirements: PHP 8.1 or higher

✨ Features

  • 📅 Calculate liturgical dates (Easter, Advent, Ash Wednesday, etc.)
  • 🎨 Determine liturgical seasons and years
  • 📖 Generate full liturgical calendars
  • 🔥 Modern PHP 8.1+ with enums, typed properties, and DateTimeImmutable
  • ✅ Full test coverage with PHPUnit
  • 🔄 Backwards compatible legacy API

🚀 Usage

Modern API (Recommended)

use RebeccaTheDev\EpiscopalDate\EpiscopalDate;
use DateTimeImmutable;

// Create an instance for today
$date = new EpiscopalDate();

// Or for a specific date
$date = new EpiscopalDate(new DateTimeImmutable('2024-03-15'));

// Get liturgical dates
$easter = $date->getEaster();              // DateTimeImmutable
$ashWednesday = $date->getAshWednesday();
$palmSunday = $date->getPalmSunday();
$pentecost = $date->getPentecost();
$advent = $date->getAdvent();

// Get season and year
$season = $date->getSeason();              // Season enum
echo $season->value;                       // "Lent"

$year = $date->getLiturgicalYear();        // LiturgicalYear enum
echo $year->value;                         // "A", "B", or "C"

// Get liturgical week
$week = $date->getLiturgicalWeek();        // "Lent 3"

// Generate a full liturgical calendar
$calendar = $date->generateLiturgicalCalendar(2024);
foreach ($calendar as $sunday => $weekName) {
    echo "$sunday: $weekName\n";
}

// Calculate dates for specific years
$easter2025 = EpiscopalDate::calculateEaster(2025);
$advent2025 = EpiscopalDate::calculateAdvent(2025);

🎯 Enums

The library provides two enums for type safety:

use RebeccaTheDev\EpiscopalDate\Season;
use RebeccaTheDev\EpiscopalDate\LiturgicalYear;

// Season enum
Season::Advent
Season::Christmas
Season::Epiphany
Season::Lent
Season::Easter
Season::Pentecost

// LiturgicalYear enum
LiturgicalYear::A
LiturgicalYear::B
LiturgicalYear::C

// Calculate liturgical year from calendar year
$year = LiturgicalYear::forYear(2024);  // LiturgicalYear::B

🔄 Legacy API (Backwards Compatibility)

For backwards compatibility with the old timestamp-based API:

use RebeccaTheDev\EpiscopalDate\LegacyEpiscopalDate;

// All methods return Unix timestamps
$easter = LegacyEpiscopalDate::easterDate(2024);
$ashWednesday = LegacyEpiscopalDate::ashWednesdayDate(2024);
$season = LegacyEpiscopalDate::liturgicalSeason(time());
$year = LegacyEpiscopalDate::liturgicalYear(time());

🧪 Development

Running Tests

composer install
vendor/bin/phpunit

Project Structure

src/
├── EpiscopalDate.php          # Main class with modern API
├── LegacyEpiscopalDate.php    # Legacy backwards-compatible API
├── Season.php                  # Season enum
└── LiturgicalYear.php         # Liturgical year enum

tests/
├── EpiscopalDateTest.php
└── LegacyEpiscopalDateTest.php

📝 License

MIT License - see LICENSE file for details

👩‍💻 Author

Rebecca Peck - oss@rebeccapeck.org

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

rebeccathedev/episcopaldate 适用场景与选型建议

rebeccathedev/episcopaldate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 rebeccathedev/episcopaldate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 rebeccathedev/episcopaldate 我们能提供哪些服务?
定制开发 / 二次开发

基于 rebeccathedev/episcopaldate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-13