Coder Social home page Coder Social logo

Comments (15)

zbraniecki avatar zbraniecki commented on June 20, 2024 1

But I also agree with @caridy that we can drop it from v1 and just make sure that our API can handle it later.

I'm no longer sure if we can drop it from v1. We implemented the v0 spec in SpiderMonkey and are now trying to use it in Firefox UI with some bestFit algorithm.

Basically, the numeric approach is required for any naive operations that don't do timezone and time-delta calculations, while text form is only applicable if you're willing to write your bestFit algo to handle that.

Thus, I'm leaning toward either recommending we do numeric only in v1, or that we add the param to v1 with defaulting to numeric.

from proposal-intl-relative-time.

zbraniecki avatar zbraniecki commented on June 20, 2024 1

@rxaviers we merged the numeric vs text. If you come up with better naming, file a new issue pls! :)

from proposal-intl-relative-time.

zbraniecki avatar zbraniecki commented on June 20, 2024

http://www.icu-project.org/apiref/icu4c/classicu_1_1RelativeDateTimeFormatter.html#a7cf748d2d9f9813e2267fe7a70a6186e

from proposal-intl-relative-time.

caridy avatar caridy commented on June 20, 2024

instead of type, should this be style and whatever is style today should be called something else? I'm bikeshedding on the names here because type sounds weird.

from proposal-intl-relative-time.

littledan avatar littledan commented on June 20, 2024

Do we actually want the numeric style? When do you want to see "1 day ago", as opposed to always using text when it's available?

from proposal-intl-relative-time.

rxaviers avatar rxaviers commented on June 20, 2024

cc @srl295 and @JCEmmons who could shed some light about the ICU design approach for allowing both forms...

from proposal-intl-relative-time.

littledan avatar littledan commented on June 20, 2024

@caridy It's hard for me to see how we could use style when that's already in use for the size. We could call it something else, but nothing immediately comes to mind for me.

from proposal-intl-relative-time.

caridy avatar caridy commented on June 20, 2024

It seems reasonable that we drop this feature for the v1, and maybe bringing it back if needed. We need a label for this.

from proposal-intl-relative-time.

zbraniecki avatar zbraniecki commented on June 20, 2024

Do we actually want the numeric style? When do you want to see "1 day ago", as opposed to always using text when it's available?

I can see it being valuable for some technical UI for consistency between "1 month ago" and "2 months ago" etc.
But I also agree with @caridy that we can drop it from v1 and just make sure that our API can handle it later.

from proposal-intl-relative-time.

srl295 avatar srl295 commented on June 20, 2024

the numeric form may fit better when it's along side other numbers, such as "The server caught fire: 3 days ago, 2 days ago, 1 day ago". where the text form may be better as a standalone singleton: "The server last caught fire: yesterday"

from proposal-intl-relative-time.

zbraniecki avatar zbraniecki commented on June 20, 2024

@rxaviers @littledan

from proposal-intl-relative-time.

littledan avatar littledan commented on June 20, 2024

@zbraniecki I don't quite understand; do you have a bug thread somewhere that provides more context?

from proposal-intl-relative-time.

zbraniecki avatar zbraniecki commented on June 20, 2024

Yeah! It's basically rxaviers epoch vs date bestFit dillema - https://bugzilla.mozilla.org/show_bug.cgi?id=1407240

from proposal-intl-relative-time.

rxaviers avatar rxaviers commented on June 20, 2024

@zbraniecki Yeap, the ability to "disable the textual forms" (e.g., to disable "Yesterday" and get "1 day ago") could be useful given your use case and @srl295's comment above.

The "hardest part" to me here seems the options names:

  • numeric vs text: I understand that the "numeric" style will disable the Yesterday-like strings, but I think it wouldn't be perfectly clear to me if I was looking at this my first time why numeric has text in it like "day ago", and the fact that "text" and "numeric" styles are identical for most of the cases except -2, -1, 0, 1, and 2.
  • ICU returns "yesterday" for "absolute unit" and "1 day ago" for "relative unit"; I see their point, but the absolute unit vs. relative unit terminology doesn't sound great to me either.

Among the two, I still prefer the numeric vs. text. I'm wondering if we had additional choices...

from proposal-intl-relative-time.

rxaviers avatar rxaviers commented on June 20, 2024

Sounds good. Thanks

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.