When I get events using rule.between() it throws wrong time as follow:
[
'Mon Jan 09 2023 05:00:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 05:30:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 06:00:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 06:30:00 GMT+0500 (Pakistan Standard Time)',
'Tue Jan 10 2023 05:00:00 GMT+0500 (Pakistan Standard Time)',
'Tue Jan 10 2023 05:30:00 GMT+0500 (Pakistan Standard Time)',
.
.
.
.
]
I know it byhour: [0, 1] is generating time in UTC and converting it to GMT+05:00 when calling rule.between(). But how can I handle hours when user select start and end time? Also I've tried to convert selected time to UTC and pass it to byhour but it generates weird dates and time. What is the purpose of tzid if it won't work with byhour attribute? Expected Result:
[
'Mon Jan 09 2023 00:00:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 00:30:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 01:00:00 GMT+0500 (Pakistan Standard Time)',
'Mon Jan 09 2023 01:30:00 GMT+0500 (Pakistan Standard Time)',
'Tue Jan 10 2023 00:00:00 GMT+0500 (Pakistan Standard Time)',
'Tue Jan 10 2023 00:30:00 GMT+0500 (Pakistan Standard Time)',
.
.
.
.
]
Please let me know how can I achieve expected result?
If user select 00:00 to 02:00 so events are generating on following time 00:00, 00:30, 01:00 and 01:30 daily or weekly
When I get events using
rule.between()
it throws wrong time as follow:I know it
byhour: [0, 1]
is generating time in UTC and converting it toGMT+05:00
when callingrule.between()
. But how can I handle hours when user select start and end time? Also I've tried to convert selected time to UTC and pass it tobyhour
but it generates weird dates and time. What is the purpose oftzid
if it won't work withbyhour
attribute? Expected Result:Please let me know how can I achieve expected result?