此包已被放弃且不再维护。作者建议使用tplaner/when包。

日期/日历递归库。

dev-master 2014-08-29 08:53 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:39:07 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文件。