Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Formatter to include support for all units #18

Merged
merged 3 commits into from
Mar 31, 2017

Conversation

README.md Outdated
-1,
"day" // "second", "minute", "hour", "day", "week", "month", "quarter", or "year".
);
// > "1 day ago"
Copy link
Member Author

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" ??
Copy link
Member Author

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...

Copy link
Member

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 .
Copy link
Member Author

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.

@rxaviers
Copy link
Member Author

@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.

@rxaviers rxaviers force-pushed the all-units-formatter branch 3 times, most recently from a37b450 to 2ebd515 Compare March 21, 2017 02:26
1. If _exists_ is *true*, then
1. Let _result_ be Get(_patterns_, ToString(_v_)).
1. Return _result_.
1. Let _v_ be _value_.[[<_unit_>]].
Copy link
Collaborator

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.

Copy link
Collaborator

@caridy caridy left a 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.

@zbraniecki
Copy link
Member

I'm all for it.

@rxaviers
Copy link
Member Author

🎉

@caridy caridy merged commit 2958372 into tc39:master Mar 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants