Coder Social home page Coder Social logo

Comments (4)

rxaviers avatar rxaviers commented on June 20, 2024

Interesting question... By the way, you're talking about this (type: "number") right?

In date format, we can have several fields in the same output. As a developer, we should to be able to identify them, e.g., let's say we need to add a markup to the month part, which could be "dd/MM" in en-GB or "M/d" in en-US.

In relative time format, the output takes two forms: (a) it includes a literal part (the message) and a number that indicates a relative distance in a certain unit, (b) the message itself is the verbose relative distance (e.g., today). In the future, relative time format could potentially include a mix of things, e.g., "tomorrow afternoon" (not even considered here, but considered in ICU).

Always using "number" seems inappropriate given (a) and (b) above alone.

Do we want to differentiate the "Tomorrow" type from the "2" type in "in 2 days"? I mean, would we use day for both or two different types? Making a parallel with date, the type of "1" or "January" are both month), so perhaps not; but note that in date format the developer knows in advance what to expect (i.e., they know the output will always by a number or a text given the formatter style, e.g., month: 2-digit). In relative time, one type of message or the other depends on message-availability given value, e.g., "2 days ago" vs. "anteontem" both represent (-2, day), the first in en, the second in pt. Develop doesn't know what to expect in advance if we use day for both forms. I'm only thinking out loud here...

from proposal-intl-relative-time.

littledan avatar littledan commented on June 20, 2024

I was assuming we'd get "literal" for "tomorrow" or "anteotem", and just get "number"/"day" for the number "2". I'm not sure how much work it will be, as well, to separate out different parts of a worded message--if CLDR even has data for this.

from proposal-intl-relative-time.

rxaviers avatar rxaviers commented on June 20, 2024

cc @zbraniecki

from proposal-intl-relative-time.

caridy avatar caridy commented on June 20, 2024

+1 on using "literal" here.

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.