Code Monkey home page Code Monkey logo

mytime.io's Introduction

mytime.io

Complete source code of https://mytime.io - a website to convert any time zone to your local time zone.

Local development

Setup

git clone https://github.com/dommmel/mytime.io
cd mytime.io
bundle install

Run

ruby app.rb

mytime.io's People

Contributors

dependabot[bot] avatar dommmel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mytime.io's Issues

Unable to use the kinda sort of an API

Hello team, maybe bacause i'm a newbie but I tried to use the API on a micro website that I have but on the chrome console says this:

Access to XMLHttpRequest at 'http://mytime.io/19:00/UTC-03:00' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
test.html:76 GET http://mytime.io/19:00/UTC-03:00 net::ERR_FAILED 200

My code is:

<p style='font-family: Montserrat;'>•	From monday to friday at 19:00 Hs, wich in your timezone is:</p>
<div data-mytime='19:00/UTC-03:00' data-mytime-showtimezone='true'>
loading..</div>
<script type='text/javascript' src='http://mytime.io/lib.js'></script>

And the text is stuck at loading.

Can I get a hint?

Thanks!

Use 24-hour clock

AM/PM is confusing. The entire point of this page is to be super clear about what time it it, and 24 hour clock is much clearer!

You could show both too, that's a good solution too.

Wrong time zone abbreviation for Brasilia Standard Time

It shows BST as the abbreviation, which actually refers to British Summer Time. It should've been BRT instead. I imagine the code trying to be clever (getting the initial letters of the words) may have many other mistakes like this.

It does show the correct time though.

Usage

add a simple usage guide to the readme

Consider daylight time when non-daylight timezone is requested during summer time

For example, when requesting

https://mytime.io/11am/PST

I get:

11am PST is
9:00:00 PM
your time
assuming the date is today and your time zone is [CEST](https://www.google.com/search?q=%22CEST%22+timezone+site:wikipedia.org&btnI)

which is correct at a level, but usually not that helpful.

I mean at the one hand the page assumes CEST based on what the browser provides and on the other hand you assume that the destination timezone doesn't observe daylight time anymore.

It's kind of common for humans to communicate timezones in appointments imprecisely.

For example, to continue to use CET and PST in the summer when daylight time is active, and not CEST, PDT etc. because people don't care enough.

Thus, it would be great for your service to provide some extra logic, e.g. cross-check whether actually daylight time is active, and then print an additional hint about that, i.e. also show the computed source time under a human interpretation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.