Coder Social home page Coder Social logo

Comments (6)

rxaviers avatar rxaviers commented on September 25, 2024 2

It's a behavior, but your question shows all developers will also be confused about it.

In practice, it's pointless to use numeric style for 0 values. You would want to see "Today" in your example instead, but in order to use "Today" correctly you need to take care of #14. Therefore, it's important to realize Intl.RelativeTimeFormat is a low level building block (at least at this point) that enables higher level abstractions such as moment.js and https://github.com/rxaviers/relative-time (used by PayPal, and by Mozilla).

from proposal-intl-relative-time.

mathiasbynens avatar mathiasbynens commented on September 25, 2024 1

FWIW, I documented numeric: 'auto' as part of https://developers.google.com/web/updates/2018/10/intl-relativetimeformat. Feel free to quote that doc if it's helpful.

from proposal-intl-relative-time.

littledan avatar littledan commented on September 25, 2024

Oops, thanks. PRs welcome!

from proposal-intl-relative-time.

romulocintra avatar romulocintra commented on September 25, 2024

Hi @littledan I'am preparing a PR based on Readme based on work done by @mathiasbynens , to have it aligned with code samples and documentation for MDN

from proposal-intl-relative-time.

romulocintra avatar romulocintra commented on September 25, 2024

I'am not sure if its a behaviour or defect :

rtf.format( -0,"day"  );  //  0 days ago 
rtf.format( 0,"day"  );   //  in 0 days

from proposal-intl-relative-time.

caiolima avatar caiolima commented on September 25, 2024

Is there anything missing to close this issue after #98 landed?

from proposal-intl-relative-time.

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.