Giter VIP home page Giter VIP logo

Comments (4)

danoscarmike avatar danoscarmike commented on June 12, 2024 1

Looked into it even more ;)

You are absolutely correct and moment() does indeed try to set the user's local time.

My own timezone settings were not configured correctly. I'm now seeing results as expected:

me@mine:~ $ football scores
Denmark 0 vs. 0 France Yesterday at 7:00 AM
Australia 0 vs. 2 Peru Yesterday at 7:00 AM
Nigeria 1 vs. 2 Argentina Yesterday at 11:00 AM
Iceland 1 vs. 2 Croatia Yesterday at 11:00 AM
Mexico 0 vs. 3 Sweden Today at 7:00 AM
Korea Republic 2 vs. 0 Germany Today at 7:00 AM

Nice looking Pacific times!

from football-cli.

manrajgrover avatar manrajgrover commented on June 12, 2024

Hi @danoscarmike

As far as I can tell, football fixtures makes use of moment.calendar() which converts date and time to text based on your local time.

Maybe I didn't quite get the issue. If you could add an example for it, it would be great. 😄

from football-cli.

danoscarmike avatar danoscarmike commented on June 12, 2024

Looking into this a bit more, according to the API's docs it returns fixture.date formatted as UTC (based on the ISO format with 'Z' and no offset).

I think the default referenceTime argument to moment.calendar() is also UTC (that is, Unix time).

Current output to date on my machine: Wed Jun 27 06:16:48 UTC 2018
Local time for me (US PST): Tue Jun 26 23:16:48

So when I run football fixtures -d 2 -l WC I get the following output:

World Cup Saudi Arabia 2 vs. 1 Egypt Last Monday at 2:00 PM
World Cup Uruguay 3 vs. 0 Russia Last Monday at 2:00 PM
World Cup Iran 1 vs. 1 Portugal Last Monday at 6:00 PM
World Cup Spain 2 vs. 2 Morocco Last Monday at 6:00 PM
World Cup Denmark 0 vs. 0 France Yesterday at 2:00 PM
World Cup Australia 0 vs. 2 Peru Yesterday at 2:00 PM
World Cup Nigeria 1 vs. 2 Argentina Yesterday at 6:00 PM
World Cup Iceland 1 vs. 2 Croatia Yesterday at 6:00 PM

What I'd like to see is, taking the Iceland v Croatia game as an example:

World Cup Iceland 1 vs. 2 Croatia Today at 11:00 AM

Thanks @manrajgrover! Really enjoying using the tool.

from football-cli.

manrajgrover avatar manrajgrover commented on June 12, 2024

@danoscarmike Thank you for looking into it!

Hope you're enjoying the world cup. :D

from football-cli.

Related Issues (20)

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.