Skip to content

[Bug]: error where tring to subscribe with timezone '+00:00' with iOS #1298

Open
@andreamattioli

Description

@andreamattioli

When Intl.DateTimeFormat().resolvedOptions().timeZone returns '+00:00' request to subscribe returns 400

Hard solution: fake timezone

(() => {
	try {
		if(Intl.DateTimeFormat().resolvedOptions().timeZone !== '+00:00') {
			return
		}
		const fakeTimeZone = 'Europe/Rome'
		
		const originalResolvedOptions = Intl.DateTimeFormat.prototype.resolvedOptions;

		Intl.DateTimeFormat.prototype.resolvedOptions = function() {
			const options = originalResolvedOptions.call(this);
			options.timeZone = fakeTimeZone
			return options;
		}
		console.log('Intl.timeZone faked as', Intl.DateTimeFormat().resolvedOptions().timeZone);
	} catch(e) {
		console.error('fakeTimeZone', e);
	}
})()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions