Closed phuongtran-rent closed 3 years ago
I knew rootcase: problem on WKST=SU or WKST=MO Default WKST=MO or WKST=MO if start date is SUN get_occurrences will not include on SUNday
WKST=SU will include date sunday as above case
SELECT * FROM unnest( get_occurrences('FREQ=WEEKLY;INTERVAL=1;WKST=SU;BYDAY=SU,MO,TU,WE,TH,FR,SA;UNTIL=20210930T110000Z'::rrule, '2021-08-01 02:00:00'::timestamp) );
WKST=MO will not include date sunday as above case
SELECT * FROM unnest( get_occurrences('FREQ=WEEKLY;INTERVAL=1;WKST=MO;BYDAY=SU,MO,TU,WE,TH,FR,SA;UNTIL=20210930T110000Z'::rrule, '2021-08-01 02:00:00'::timestamp) );
Fond rootcause isssue
Please help me to explain what i am wrong case 1:
SELECT * FROM unnest( get_occurrences('FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA;UNTIL=20210930T110000Z'::rrule, '2021-07-31 02:00:00'::timestamp) );
Show data: "2021-07-31 02:00:00" "2021-08-01 02:00:00" "2021-08-02 02:00:00" "2021-08-03 02:00:00" ...... "2021-09-30 02:00:00"wrong case 2: It did not include 2021-08-01 02:00:00
SELECT * FROM unnest( get_occurrences('FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA;UNTIL=20210930T110000Z'::rrule, '2021-08-01 02:00:00'::timestamp) );
Show data: "2021-08-02 02:00:00" "2021-08-03 02:00:00" "2021-08-04 02:00:00" .... "2021-09-30 02:00:00"Case 2 did not include date on 2021-08-01 02:00:00, Please help me to correct it
Thanks