starx/when

日期/日历递归库。

维护者

详细信息

github.com/starx/When

主页

源代码

安装: 926

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 96

v0.4 2017-02-13 12:43 UTC

This package is not auto-updated.

Last update: 2024-09-26 19:32:24 UTC


README

##When 日期/日历递归库,适用于 PHP 5.3+

Build Status

作者:Tom Planer

###关于 When 的第二个版本。

###当前功能 目前这个版本具有版本 1 所有的功能,它还支持按小时、按分钟和按秒。请查看 单元测试 了解如何使用它。

我将在完成文档后立即用这个版本替换版本 1。在此之前,这里有一些简单的示例

// friday the 13th for the next 5 occurrences
$r = new When();
$r->startDate(new DateTime("19980213T090000"))
  ->freq("monthly")
  ->count(5)
  ->byday("fr")
  ->bymonthday(13)
  ->generateOccurrences();

print_r($r->occurrences);



// friday the 13th for the next 5 occurrences rrule
$r = new When();
$r->startDate(new DateTime("19980213T090000"))
  ->rrule("FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13")
  ->generateOccurrences();

print_r($r->occurrences);

###许可证 When 采用 MIT 许可证,具体细节请参阅 LICENSE 文件。