The date_recur field should work the same as a date_range field when no RRULE is provided.

  • Add tests and ensure non RRULE works.
  • If a field doesnt contain a RRULE, the same basic API's for getting occurrences should work correctly. That is, one fake occurrence should be created.

Comments

dpi created an issue. See original summary.

dpi’s picture

Status: Active » Needs review
StatusFileSize
new13.54 KB
dpi’s picture

StatusFileSize
new13.46 KB
dpi’s picture

StatusFileSize
new13.46 KB
dpi’s picture

StatusFileSize
new13.4 KB
dpi’s picture

StatusFileSize
new14.71 KB

  • dpi committed d576364 on 8.x-2.x
    Issue #2993554: Non recurring date values must generate occurrences.
    

  • dpi committed 7f2e737 on 8.x-2.x
    Issue #2993554: Clean up cache storage occurrence helper.
    
    Thanks to new...
joelpittet’s picture

Status: Needs review » Needs work

I'm liking the look of this clean up. Question about this bit of code:

+++ b/src/DateRecurNonRecurringHelper.php
@@ -0,0 +1,102 @@
+      yield $occurrence;

What is yield ?

Couldn't find it in php.net/yield

joelpittet’s picture

Status: Needs work » Needs review

Strange that didn't find it but I guess it has to be a function, learned something new:)
http://php.net/manual/en/language.generators.syntax.php

dpi’s picture

Generators are a lot of fun.

Basically PHP will keep a function around in memory similar to a process. If you iterate over the function new values are generated. The function will pause (like a process) if/until the next iteration happens.

joelpittet’s picture

StatusFileSize
new706 bytes

Not sure if you want a new issue for this but here's a quick patch for a missing isRecurring() call.

joelpittet’s picture

Also, re generators. I wonder what the performance implications are of keeping them in memory are, have you profiled them before?

joelpittet’s picture

They look pretty much the same in my super poor profile:)
https://3v4l.org/KJMt3/perf#output
https://3v4l.org/BskcY/perf#output

dpi’s picture

Status: Needs review » Fixed

#12 no longer relevant as the method was removed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.