Opened 4 years ago

Last modified 3 months ago

#10660 assigned feature request

Time zone suggester based on nascent WordPress.org API call

Reported by: sambauers Owned by: rmccue
Priority: normal Milestone: Future Release
Component: Date/Time Version: 2.8.4
Severity: normal Keywords: has-patch gci
Cc: otto@…, cnorris23@…, d@…, travis@…

Description

The attached patch uses a new API call to http://api.wordpress.org/core/ip-to-zoneinfo/1.0/ to retrieve a suggested time zone based on client (not server) IP address.

A button is added next to the existing dropdown list of time zones providing the option to "Suggest a time zone". This calls the API using an AJAX/JSONP request which then auto-selects a time zone for the user from the dropdown.

Visual feedback is via a spinner when fetching and then a text response.

Additionally the Date and Time settings have been split out to a new settings page.

Related ticket: #10324

Attachments (3)

datetime-and-timezone-suggest.patch (22.2 KB) - added by sambauers 4 years ago.
10660.diff (4.1 KB) - added by rmccue 2 years ago.
Updated (and simpler) patch
10660-refresh.diff (3.5 KB) - added by rmccue 7 months ago.
Refresh patch

Download all attachments as: .zip

Change History (18)

An attribution for use of GeoNames will need to be included somewhere in the interface or on the WordPress.org site/docs for us to be able to use this.

  • Cc otto@… added
  • Cc cnorris23@… added
  • Milestone changed from Unassigned to 3.1
  • Type changed from task (blessed) to feature request

Moving to 3.1. Not sure we need to spawn another options panel for this though.

  • Milestone changed from Awaiting Triage to Future Release

rmccue2 years ago

Updated (and simpler) patch

  • Keywords gci added
  • Owner set to rmccue
  • Status changed from new to assigned

This updated patch does the same as Sam's, but simpler, and also asks the user before using the supplied timezone as the value.

  • Cc d@… added

I see this as "pure" JS based solution. The browser "knows" the right timezone and the UTC offset. The user's IP might not be in the same timezone (proxy?).

We have a name-to-zoneinfo API call too:

http://api.wordpress.org/core/name-to-zoneinfo/1.0/?callback=abcd&s=memphis

Could be good for auto-suggest based on search string.

rmccue7 months ago

Refresh patch

#10324 was marked as a duplicate.

#9759 was marked as a duplicate.

  • Component changed from Administration to Date/Time
  • Cc travis@… added

http://pellepim.bitbucket.org/jstz/ might be a candidate for use... grabs a timezone as opposed to a UTC offset, and is MIT licensed so inclusion in core should be possible.

Not my area of expertise, but if it works, then great.

I'm not one to look a gift horse in the mouth ;)

Note: See TracTickets for help on using tickets.