Open rxaviers opened 9 years ago
Been working on this, it's not super pretty but it works.
I'm taking a look at the style guide now, but if this looks good I can submit the PR.
Update: I moved the inputs to the table and added relative time and date format:
Let me know how this looks!
@sotojuan this is looking great. Although, note the following.
When we change the formatter value only (e.g., changing the number in the first example), we use the same formatter to format various values, which is great. When we change the formatter options (e.g., changing the currency code, date pattern, or relative time unit), we are actually using different formatters, not reusing a formatter, which has its consequences: while it works just fine in development mode, where you can generate any formatter, it won't work in production mode, where it's expected that the formatter be compiled and available.
To make long story short, make dynamic the formatter values only, i.e.:
Does it sound good?
Thanks so far!
PS: Note you can make the relative time or patterns dynamic, but that would require a code analogous to https://github.com/jquery/globalize/pull/481#issuecomment-140340869.
Gotcha, I made the following changes:
Let me know how this looks! I just need to handle bad inputs, add some comments, and look at the style guide again.
@sotojuan sorry for my delayed answer, it looks better. From the picture above, I read Change format
, but I guess it's only a matter of updating the button title to Change date
right?
Yep, thanks for catching that. I'm a bit busy now but later I will clean it up and follow the style guide and submit a PR. Thanks!
Excellent. Looking forward to it and thanks.
Allow user to change number, currency, and the number of remaining tasks for the pluralization example.
This issue has been motivated by @sompylasar comment: