Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 8b956da3 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

Receive Timezone from Intl.DateTimeFormat if available

parent 137ede57
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -27,6 +27,13 @@ import jstz from 'jstz'
 * @returns {String} Current timezone of user
 */
export default () => {
	if (window.Intl && typeof window.Intl === 'object') {
		const { timeZone } = Intl.DateTimeFormat().resolvedOptions()
		if (timeZone) {
			return timeZone
		}
	}

	const determinedTimezone = jstz.determine()
	if (!determinedTimezone) {
		return 'UTC'