Open romulocintra opened 5 years ago
cc @jahzielv @littledan @sffc
Gonna start working on this one!
For the README, what all do you think we need to add?
As far as MDN goes, it seems that currently the options are just listed out on the DateTimeFormat page. Should I just add the new options to that list, or do we want to restructure those out into their own pages?
Hi @jahzielv I did a little review between doc's pages and they aren't much consistent at the level of structure. But regarding this is normal to have a list of options.
I would have only options and if possible complement with more examples interactive or not.
The new dateStyle/timeStyle should be called out in the intro for sure. Users should generally use the new options instead of the old options; the old options are good for power users but not the casual developer who just wants to display a date or time. When I take a 30-second glance at the doc page, that's the impression I should come away with.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
I've added a note about the new options to the intro, as well as describing them in the list of options. Looking good so far?
@jahzielv I think some example would be really beneficial here.
Edit: Those properties aren't currently implemented in browsers, aren't they? I believe they are just in the stage-3 now. This makes the docs really misleading. I tried to make them work because I've seen them on the MDN page and my search for some examples led me here. I could add some note on the MDN page that those properties are still yet to be implemented if you would confirm.
Stage 3 is when many browsers begin shipping features, fwiw.
@mwanago thanks for your comment , our goal is to have the most clear and direct documentation possible to avoid any misleading .
I will deleting the new options from top paragraph.
Meanwhile new options should be added in Browser Compat Data that way is easier to know where this new API' s are available.
Would be nice in future have a clear way to express this in MDN - badge(new) or similar.
PR's are welcomed to.
Thanks again
@romulocintra how would we update compat data for these additions? From my experience with compat data, it only applies to objects/functions, not to options that can be passed in. Is there a particular way to handle this?
Hi @jahzielv
I would use same format they are using for other similar cases like "hourCycle"(isn't the same i know) option where they fill the compat data like this
Or probably open an issue using their :
@jahzielv compat-data already added following same style for hourCycle
Why do you like to make such a big mess? I think it would be a little easier to kind of
(new Date())->format('d-m-Y'); // 24/07/2020
new Intl.DateTimeFormat("es",{ISO:'d-m-Y'}).format(Date.now()); // 24/07/2020
I apologize if this doesn't go here, but I don't know where I can make a request or show my disagreement with Javascript and the dates.
@chiqui3d it doesn't go here, this issue is related & labelled as documentation
, as previously suggested you can follow #190. If you want to help, this issue still not completed, missing Interactive examples in MDN.
Any contribution is welcome
Create Documentation for Intl.DateTimeFormat
dateStyle
andtimeStyle
Intl.DateTimeFormat MDN page
Interactive Examples MDN :
[ ] Generic Usage
Browser compat-data :