elabx/fieldtype-recurring-dates

使用 RRule 设置周期性日期的字段

v0.0.1 2024-07-03 18:35 UTC

README

这是一个预发布版本,请不要在生产环境中使用。

FieldtypeRecurringDates

inputfieldrecurringdates

根据 RFC-RFC 5545 和出色的库 php-rrule 定义周期性日期的字段和输入字段

安装

composer require elabx/fieldtype-recurring-dates

请确保安装 FieldtyeRecurringDates 和 AlpineJS 模块。此外,您还可以安装 RecurringDatesFinder 以进行搜索操作。

或者通过过程Wire模块目录下载。

此模块将保存RRule的发生次数到数据库中,以便稍后查询。

查找具有字段的页面

使用对日期选择器有效的日期值。

$pages->find('recurring_meetings=>today')

查找发生次数

您可以使用同一包中包含的模块来查找规则的发生次数

$start$end 值是 $datetime 任何可接受的值

$finder = $modules->get('ReccurringDatesFinder')
$output = $finder->find(
     // from date 
    'today', 
    // to date
    '+30 days', 
    $selector, [
        'fields' => [ // Will find event occurrences in fields specified in this array 
            'recurring_meetings',
            'recurring_events'
        ]
    ]

此方法将返回指定字段的SQL UNION结果。

您还可以挂钩到 getRecurringFieldQueries() 以添加要添加到最终UNION查询的查询。

待办事项

  • 添加 BYSETPOS 支持
  • 添加 "永不" 选项支持

愿望清单

  • 支持纯文本 RRule
  • 添加对 BYWEEKNO、BYYEARDAY、BYMONTHDAY、BYMINUTE、BYHOUR、BYMINUTE、BYSECOND 的支持。
  • 添加在保存之前修改 RRule 的支持?也许跳过
  • 使用 RSet 而不是 RRule 吗?