dragfyre / bahai-date-api

RESTful API for the Baha'i (Badi) calendar.
ISC License
7 stars 4 forks source link

Get today for any time zone. #34

Open azatserzhan opened 1 year ago

azatserzhan commented 1 year ago

Alla-u-Abha dear friends! We are using this API for Baha'i book app. (https://play.google.com/store/apps/details?id=kz.tilsimsozder) Currently GET only for time_zone: Asia/Jerusalem

azatserzhan commented 1 year ago

Sorry, your API has a timeZone param!

brettz9 commented 1 year ago

Alláh-u-Abhá!

You can supply a timezoneId, yes, but it seems we're not supplying back hours(/minutes/seconds) or the timezone offset for the supplied id.

In looking at the BadiDate software we are using, I don't see how the underlying time info is actually using the timezone so that we could supply users with the (server-independent) time information. I plan to look into this.

brettz9 commented 1 year ago

I think I have a fix for this, but need some discussion with @dragfyre when he is free about the exact format to use.

dragfyre commented 1 year ago

PR #35 approved! Please let us know if there are any further issues.

brettz9 commented 1 year ago

@azatserzhan : The master version of bahai-date-api is now deployed to bahai-browser.org, so you can get it through, e.g.,

https://bahai-browser.org/today?timezoneId=America/Phoenix&latitude=32.45&longitude=-111.21 https://bahai-browser.org/today?timezoneId=Asia/Hong_Kong&latitude=22.5&longitude=113.93

etc.

Please note from the above that you have to supply your own latitude and longitude and we are not currently able to auto-detect the timezone based on the latitude and longitude.

Let us know if that works for you.