Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92785321
PhutilCalendarRecurrenceList.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 23, 17:10
Size
846 B
Mime Type
text/x-php
Expires
Mon, Nov 25, 17:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22513151
Attached To
rPHU libphutil
PhutilCalendarRecurrenceList.php
View Options
<?php
final
class
PhutilCalendarRecurrenceList
extends
PhutilCalendarRecurrenceSource
{
private
$dates
=
array
();
private
$order
;
public
function
setDates
(
array
$dates
)
{
assert_instances_of
(
$dates
,
'PhutilCalendarDateTime'
);
$this
->
dates
=
$dates
;
return
$this
;
}
public
function
getDates
()
{
return
$this
->
dates
;
}
public
function
resetSource
()
{
foreach
(
$this
->
getDates
()
as
$date
)
{
$date
->
setViewerTimezone
(
$this
->
getViewerTimezone
());
}
$order
=
msort
(
$this
->
getDates
(),
'getEpoch'
);
$order
=
array_reverse
(
$order
);
$this
->
order
=
$order
;
return
$this
;
}
public
function
getNextEvent
(
$cursor
)
{
while
(
$this
->
order
)
{
$next
=
array_pop
(
$this
->
order
);
if
(
$next
->
getEpoch
()
>=
$cursor
)
{
return
$next
;
}
}
return
null
;
}
}
Event Timeline
Log In to Comment