4/12/2019

MS Graph, Events, and Time Zones in SPFx

Working with time zones is always a mess, whatever language, technology stack or environment you're in. There are always different issues on how to convert dates, get correct time zone and so on.
Currently I'm working on SPFx solution that should create an event in Outlook calendar.
User should be able to select date, time, and time zone of the event.
Time zone selection dropdown should display friendly names like that:

And the dropdown initial selection should be based on browser's (computer) time zone.
Below I'm providing some thoughts on the implementation, unfortunately without final solution for now. All the thoughts are based on the SPFx stack.

4/02/2019

MS Graph: Get DriveItem by File Absolute Url

Microsoft Graph allows to work with OneDrive files and SharePoint documents using DriveItem resource type. Using this entity you can read information about a file, such as size, content, file type, and so on (here is a link to the resource type documentation).
You can get DriveItem object from a specific Drive, Site, Group, or user's connected OneDrive. But for all of these operations you need to know identifiers of parent resources, e.g. drive id, or site id (documentation on how to get drive item).
But what if the file is located in a custom document library, in a subfolder, and on a subsite? And you have only absolute url for the document, like https://your-tenant.sharepoint.com/sites/your-site/your-subsite/DocLibrary/subfolder/file.ext?