globalizejs / globalizejs/globalize

Minor clarification to initial code example in docs.

Open
#610 1 comment 0 reactions 0 assignees View on GitHub
docs
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

Hello all -

First off thanks for this project. Amazing work!

I'm writing bc I made a silly (?) assumption when I started working with this project that almost caused me to go try something else. My mistake I think but I'd like to suggest a minor clarification to a documentation.

I wrote up this [stackoverflow issue](http://stackoverflow.com/users/2631342/darrin?tab=reputation) issue to explain.

I think if you alter the first code example - it would've saved me a chunk of time. In short, my misunderstanding was that `Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es" ) )` meant load all locales for English and Spanish. But in fact that didn't seem to work for me.

If you include a language-locale combination in the initial example I think that would help people (me at least) make the mental leap that this isn't doing something more extensive and that the locale is important in addition to the language!

```
var Globalize = require( "globalize" );
Globalize.load( require( "cldr-data" ).entireSupplemental() );
Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es-MX" ) );

Globalize("en").formatDate(new Date());
// > "11/27/2015"

Globalize("es-MX").formatDate(new Date());
// > "27/11/2015"
```

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.