I have a site with a calendar. In the calendar I have a mix of recurring and non-recurring events.
On a WebPart page I have a CEWP that uses WebServices (
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="..." xmlns:xsi="..." xmlns:xsd="..."> <soap:Body> <GetListItemsResponse xmlns="..."> <GetListItemsResult> <listitems xmlns:s='...' xmlns:dt='...' xmlns:rs='...' xmlns:z='...'> <rs:data ItemCount="1"> <z:row ows_Title='recurring meeting one' ows_EventDate='2016-01-26 11:00:00' ows_EndDate='2016-01-26 12:00:00' ows_Description='...' ows_fRecurrence='1' ows_RecurrenceData='...' ows_fAllDayEvent='0' ows__ModerationStatus='0' ows__Level='1' ows_ID='2.0.2016-01-26T16:00:00Z' ows_UniqueId='...' ows_owshiddenversion='2' ows_FSObjType='2;#0' ows_Created='2015-10-22 08:34:47' ows_PermMask='0x7fffffffffffffff' ows_Modified='2015-10-22 09:22:05' ows_FileRef='2;#/xxx/Lists/Meeting Calendar/2_.000' ows_MetaInfo='2;#' /> </rs:data> </listitems> </GetListItemsResult> </GetListItemsResponse> </soap:Body> </soap:Envelope>
What I'm trying to do now is iterate over each event to see if it is occurring right now.
I could use
new Date() to get the date now, but that would be for the client's timezone/settings. The SharePoint site may use a different regional setting. And, the user's regional settings may inherit from the site or the user may have their own regional setting -- both of which would effect the output from the
Ideally I'd love a way to get the current time accounting for, in order:
- the user's regional settings
- the site's regional settings if the user is inheriting from the site