-
Notifications
You must be signed in to change notification settings - Fork 24
Formatter to include support for all units #18
Conversation
README.md
Outdated
-1, | ||
"day" // "second", "minute", "hour", "day", "week", "month", "quarter", or "year". | ||
); | ||
// > "1 day ago" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is not using the text type.
README.md
Outdated
// > "in 100 days" | ||
|
||
rtf.format(0, "day"); | ||
// > "0 days ago" / "in 0 days" ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we have this situation using this approach. Need to evaluate what ICU does...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's "0" and "-0" in JS. We may want to use it.
README.md
Outdated
@@ -24,7 +24,7 @@ TBD | |||
|
|||
### Informative | |||
|
|||
This proposal is based on Unicode Relative Date Time Format method. | |||
This proposal is based on Unicode Relative Date Time Format method and on the ICU . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Update this information appropriately.
@caridy and @zbraniecki I'm creating this PR for early feedback, therefore I started by updating the README examples so that we exercise this approach in a clear manner. |
a37b450
to
2ebd515
Compare
2ebd515
to
145b76e
Compare
1. If _exists_ is *true*, then | ||
1. Let _result_ be Get(_patterns_, ToString(_v_)). | ||
1. Return _result_. | ||
1. Let _v_ be _value_.[[<_unit_>]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going forward we want to avoid accessing internal slots for computed values, e.g.: [[<x>]]
, I'm ok with this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this as it is assuming that we all agree on the unit be the second argument of the format() and formatToParts() method.
I'm all for it. |
🎉 |
This is a WIP PR that will eventually:
best fit
#12now
when calling format() #4TODO