Comments (15)
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.
@rxaviers we merged the numeric vs text. If you come up with better naming, file a new issue pls! :)
from proposal-intl-relative-time.
from proposal-intl-relative-time.
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.
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.
cc @srl295 and @JCEmmons who could shed some light about the ICU design approach for allowing both forms...
from proposal-intl-relative-time.
@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.
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.
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.
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.
from proposal-intl-relative-time.
@zbraniecki I don't quite understand; do you have a bug thread somewhere that provides more context?
from proposal-intl-relative-time.
Yeah! It's basically rxaviers epoch vs date bestFit dillema - https://bugzilla.mozilla.org/show_bug.cgi?id=1407240
from proposal-intl-relative-time.
@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
vstext
: 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.
Sounds good. Thanks
from proposal-intl-relative-time.
Related Issues (20)
- Docs(MDN) : Intl.RelativeTimeFormat HOT 9
- Update status on README
- Handle cut-off logic / distance with a given Date HOT 5
- Accept BigInt in format/formatToParts HOT 2
- Ambiguous Polyfills section in docs HOT 2
- Add an option to remove the prefix HOT 2
- It would be nice to document the expected placeables in the pattern. HOT 5
- request New API for format relative time from now HOT 5
- Review @@toStringTag value HOT 1
- "an optional argument value" HOT 1
- Remove references to InitializedIntlObject HOT 3
- Create options objects with null proto HOT 1
- Question: why is minimumIntegerDigits set to 2? HOT 6
- Question: What about other NumberFormat options? HOT 2
- resolvedOptions does not need undefined check
- isFinite() does not seem to be formally defined HOT 1
- Review handling of "narrow" style HOT 6
- Incorrect "yesterday" examples HOT 6
- PartitionRelativeTimePattern accepts non-time values HOT 1
- Allow to modify the numbering system through "nu"? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-intl-relative-time.