tc39 / proposal-intl-datetime-style

dateStyle and timeStyle options for DateTimeFormat
https://tc39.github.io/proposal-intl-datetime-style/
28 stars 9 forks source link

Docs(MDN) Update Documentation Intl.DateTimeFormat `dateStyle` and `timeStyle` #33

Open romulocintra opened 5 years ago

romulocintra commented 5 years ago

Create Documentation for Intl.DateTimeFormat dateStyle and timeStyle

Intl.DateTimeFormat MDN page

Interactive Examples MDN :

romulocintra commented 5 years ago

cc @jahzielv @littledan @sffc

jahzielv commented 5 years ago

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?

romulocintra commented 5 years ago

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.

sffc commented 5 years ago

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.

jahzielv commented 5 years ago

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?

mwanago commented 5 years ago

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

ljharb commented 5 years ago

Stage 3 is when many browsers begin shipping features, fwiw.

romulocintra commented 5 years ago

@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

jahzielv commented 4 years ago

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

romulocintra commented 4 years ago

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 :

image

romulocintra commented 4 years ago

@jahzielv compat-data already added following same style for hourCycle

romulocintra commented 4 years ago

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